Git notes exercise

  1. Git is the program for making commits locally, github is the platform that hosts the repos.
  2. The staging area is where changes are recorded of files in the working directory.
  3. You can add a message to your commit.
  4. Merging is when you merge two branches together, rebasing is when you move or combine a sequence of commits to a new base commit.
  5. It clones an online git repo to your local computer.
  6. Forking is when you make a copy of a repository to your account instead of the account owner.
  7. You assign your custom domain to your github pages website.
1 Like
  1. What is the difference between git and github?
    Git : version control system
    Github: hosting service for our git repositories

  2. What is the staging area?
    it is the area where you see store your git before commited code to Github

  3. What does the -m switch do in git commit?
    -m switch let you type a msg

  4. What is the difference between merging and rebasing?
    Merginf incorporates the changes of the commits in the current branch and Rebasing compresses all the changes in a single patch.

  5. What does git clone do?
    the clone basicalle copy an existing repository in a new directory locally on the pc

  6. What is forking?
    it is a copy of the original repository and this one stay on the github account

  7. How can we host a website on GitHub Pages?
    create a repository first with html file and pass a url , here : github.io

1 Like
  1. Git is a version control software which enables one to track changes to their local files and commit them. Whereas GitHub is an online cloud storage to push files/folders tracked on git to GitHub.

  2. The next file or files that are to be the next version of the next commit.

  3. -m is short for the message to add when committing files.

  4. merging is when the changes of the master branch and a alternative branch gets combined into a single fork. Whereas rebasing moves changes from the alternative branch to join the tail end of the master branch.

  5. git clone makes a copy of a particular repository to a different location.

  6. A fork is a divergence from an existing branch which enables committing changes to the newly created branch without impacting the state of the existing branch it was copied from.

  7. This can be done by creating a repository on GitHub with a HTML file, while having the account holder’s username part of the URL.

1 Like
  1. What is the difference between git and github?
  • Git is a version control system running locally.
  • Github is a hub where we can post a project with its version history.
  1. What is the staging area?
  • When we modify a file, it goes to the staging area.
  • When we have done modifying for a current commit, we do the commit and the staging area is cleared.
  1. What does the -m switch do in git commit?
  • It indicates that a message will be attached to the commit.
  1. What is the difference between merging and rebasing?

Let’s say two developers are working on two different features of a project at the same time. This will create a fork (or two branches) in the history. There are two ways to end up with both features implemented:

  • Merging - join the branches together, which creates a forked and then merged timeline <===>;
  • Rebasing - add one branch on top of the other, which creates a non-forked timeline —__—.
  1. What does git clone do?
  • It is a convenient way to copy-paste a whole project into your own repository.
  1. What is forking?
  • Creating another version of a project without intention to merge later. This keeps a common history with the original.
  1. How can we host a website on GitHub Pages?
  • When we name a repository [name].github.io, it is automatically hosted on Github pages.
2 Likes
  1. git: Is a software that handles source code versioning, letting you make and track local file changes and share changes with a remote repository.

GitHub: Is a cloud service for remote hosting of git repositories. In addition to hosting your code, the site helps manage software development projects with features like issue tracking, collaborating with other GitHub users, and hosting web pages.

  1. It is like a rough draft space , it’s where you can git add the version of a file or multiple files that you want to save in your next commit (in other words in the next version of your project.

  2. It allows a message to be added to a commit.

  3. merging and rebasing are two strategies for updating the contents of one branch based on the contents of another. Merging joins the history of two branches together with a merge commit (a commit with two parent commits); and rebasing creates new, reparented commits on top of the existing commits.

5.git clone is a git command line utility used to target an existing repository and create a clone, or copy of the target repository.

  1. After using GitHub by yourself for a while, you may find yourself wanting to contribute to someone else’s project. Or maybe you’d like to use someone’s project as the starting point for your own. This process is known as forking. Creating a “fork” is producing a personal copy of someone else’s project.

7.http://username.gihub and index.html

1 Like

1. What is the difference between git and github?

  • Git is a local version control system, while GitHub is a collection of public and private repositories available through a UI.

2. What is the staging area?

  • This is an intermediate area where commits can be formatted and reviewed before completing the commit.

3. What does the -m switch do in git commit?

  • It allows to attach a message/comment to a commit that makes it easy to trace later on.

4. What is the difference between merging and rebasing?

  • Merging brings two branches together and if there are conflicts allows the user to edit them.

  • With rebasing, the commits that were previously saved into the temporary area are reapplied to the current branch, one by one, in order. This will flatten out the history of commits.

5. What does git clone do?

  • Cloning creates a copy of an existing repository at the current location.

6. What is forking?

  • Forking is creating a new repository as a copy of another. Changes made to the new project will not affect the original one. E.g. like BTC and BCH.

7. How can we host a website on GitHub Pages?

  • The repository we want to be hosted needs to be renamed into: GitHubUserName.github.io, which will automatically update as we push changes. This is also going to be the URL for the hosted site.
3 Likes

1. What is the difference between git and github?

Git is a version control software, github is a website to host projects.

2. What is the staging area?

The files and changes we want to commit on git go in the staging area.

3. What does the -m switch do in git commit?

Enables us to add a comment on the commit. We can detail the changes we made, and so on, so it is going to be easier to understand later what was the commit used for.

4. What is the difference between merging and rebasing?

Merge will bring the code from the feature branch into the master branch.
Rebase will keep the feature branch, but it will re-anchor it to the latest node of the master branch.

5. What does git clone do?

It will create a local copy of a github repository.

6. What is forking?

Forking is making a copy of an existing github repository to a new repository and start working on that base.

7. How can we host a website on GitHub Pages?

Create a new repositroy with username.github.io. Clone the repository we want to host and add an index.html. We can also set up templates and track changes to our project.

2 Likes
  1. Git is a decentralized source control management system where we can track our changes as we develop programs or codes. While Github is basically a web interface for git, where we can host and collaborate git repositories.

  2. Staging area is like a holding area for the changes that is to be committed.

  3. -m switch allows us to save a short description of what we are trying to commit.

  4. Merging is resolving a conflict at once and that is joining two (left and right) branches which results to a not fully linear history. Rebasing on the other hand is, resolving a conflict by overriding the history and make sure that all the changes are in one line (linear).

  5. Git clone allows us to create a copy of a repository in our local computer and make changes or modify the repository to our liking.

  6. Like git clone, forking is also a way to create a copy of the repository but this time it is in our github account.

  7. To host a website on github, we can easily copy others repository by forking (P.S. only if permitted or allowed) then go to settings and change the repository name to our github username and add .github.io
    For example: username.github.io

3 Likes
  1. Git is a version control system and GitHub is a hosting platform for Git that allows collaboration and software development.

  2. The staging area is where changes go when they are added and tracked. It is one step away from being committed.

  3. The -m switch allows the message to be written inline with the command instead of having to do it in the editor.

  4. Merging is combining commits on separate branches onto the current branch. Rebasing changes the history by moving all the separate branches onto the master branch history.

  5. Git clone will get a copy of an existing Git repository. Every file from the server is pulled down and an exact copy is made.

  6. Forking is when a repository is copied and changes are made that aren’t pushed to the original and a whole new version based on the original is made.

  7. When you are choosing the name of your repository, change the name in settings to “username.github.io” and if it is available then you can host the website on GitHub.

2 Likes
  • What is the difference between git and github?
    Git is a version control system; GitHub is a website provides hosting for git repositories, facilitating collaboration.

  • What is the staging area?
    Staging area contains the files that that will be committed once git commit is called. Git tracks these files for changes.

  • What does the -m switch do in git commit?
    Allows us to specify a commit message after the switch.

  • What is the difference between merging and rebasing?
    Merge merges another branch with the current version of a branch, preserving the histories of both branches; rebase moves the current branch to the tip of another branch, so that the other branch is merged with ALL versions of the current branch, changing commit history.

  • What does git clone do?
    Downloads and makes a local copy of an existing remote git repository. A cloned repository will not be connected to the main repository, so you can’t pull down changes from the main repo or create pull requests.

  • What is forking?
    Creating a copy of a repository to experiment / develop features without affecting the master / stable branch. A fork is linked to the main project - for example, if a developer completes a feature in a forked branch, they can make a pull request, which can lead to the fork being merged with the main branch.

  • How can we host a website on GitHub Pages?
    We need to create a new GitHub repository called “username.github.io”, we can then push files into that repository, which will be hosted at username.github.io by default.

2 Likes
  1. git is a version-control software system while Github is a cloud-based hosting service for git repositories.
  2. These are files that have been added to git but not committed yet.
  3. It attaches the following message to the commit
  4. Merging is simply a process of reconciling commits so that all changes are combined and any clashes are addressed. Rebased is a movement of a whole version sub-tree to a different point in the version history (effectively ‘rewriting history’).
  5. It copies a repository.
  6. Copying a repository to your own folders so you can separately work on it.
  7. First create a repository called {yourusername}.github.io. Then create or select a theme and commit an index.md page.
1 Like
  1. What is the difference between git and github?
    Git is the local repository version-control system, github is a web interface for repositories that everyone can access.
  2. What is the staging area?
    The staging area is where you add files that will be part of the next commit.
  3. What does the -m switch do in git commit?
    The -m switch attaches a message to the commit.
  4. What is the difference between merging and rebasing?
    With merging, the existing braches are not changed.
    Rebasing re-writes the project history by creating brand new commits for each commit in the original branch.
  5. What does git clone do?
    git clone makes a local copy of the remote repository.
  6. What is forking?
    A fork is a copy of a repository. Forking a repository allows to freely experiment with changes without affecting the original project.
  7. How can we host a website on GitHub Pages?
    Create a repository, rename it to username.github.io.
1 Like
  1. Git is your local repository sitting on your computer,
    while Github is a web repository that everyone can access assuming that they have the keys or they collaborate with others.

  2. Staging area is the area in git, where it contains the changes before it will be committed into the git repository.

  3. The -m switch allows us to switch to another branch and “-m” stands for message which allows us to specify a message in our commit for reference,
    the message should be a short description of the changes being committed, and this message will be at the end of the command which will be wrapped in quotation marks.

  4. Merging is where you have two branches and you create a third commit that has two parents,
    While Rebasing is where you can fully read a linear history, which means changes are already in one line.

  5. Git clone is a way of copying the source code coming from a remote git repository to have it locally stored in to our own personal computer.

  6. Forking is making a copy of a repository that will stay on your github account,
    you can developed that project on your own without affecting the main project with your changes base on your liking, its like having your own version of the project. But if you would like to contribute your changes to the original project, you can ask for a pull request to the owner of the original repository and he/she will decide if your changes will be merged to the original project. The difference between forking and cloning is that forking has a connection to the original repository.

  7. Create a github account,
    create a repository and named it yourgithubusername.github.io and
    it will automatically hosted on Github pages
    push files in to that repository
    and that same repository name will also serve as the default url for the hosted site.

2 Likes
  • What is the difference between git and github?
    git is the version control where you code and developed while github is the hosting server where everyone can see the code.
  • What is the staging area?
    Is the area that contain changes and you can commit. you can either reverse this changes
  • What does the -m switch do in git commit?
    put a message on the commit
  • What is the difference between merging and rebasing?
    With merge you can unified to branches, rebase rewrites and combine into one commit. in a linear manner
  • What does git clone do?
    Makes a copy to the original
  • What is forking?
    A copy that you can manipulate without using the original. You can delete it later.
  • How can we host a website on GitHub Pages?
    create a repository with your username example myusername.github.io
1 Like
  1. What is the difference between git and github?
    git is a version control system. Github allows you to manage Git repositories.
  2. What is the staging area? The staging area keeps track of your current changes where you can modify existing files or add new ones. When you are happy with your changes you can git commit them.
  3. What does the -m switch do in git commit?
    Allows you to add a message.
  4. What is the difference between merging and rebasing?
    Rebase moves a feature branch into a master. Git merge adds a new commit, preserving the history.
  5. What does git clone do?
    It copies an existing git repository.
  6. What is forking?
    Forking is like git clone but done on the remote server.
  7. How can we host a website on GitHub Pages?
    Create a repository name “username.github.io” and push your website code to it.
1 Like
  1. What is the difference between git and github?
    Git is a version control system that let’s you host and keep track of your source code history.
    Whereas Github is a cloud-base hosting that let’s you manage Git repositories.
  2. What is the staging area?
    It is an area where you can post your work before posting it on on the git repository. You use git.add to add it to the staging area, you will use git.commit to post it on GitHub.
  3. What does the -m switch do in git commit?
    The -m switch allows you to add a new message to a commit.
  4. What is the difference between merging and rebasing?
    Both merging and rebasing can be used to combine 2 branches. Merge command unifies your work with a commit without changing history. Rebasing apply feature branch changes on top of master branch and change the history.
  5. What does git clone do?
    It give you the ability to work with the entire repository which means that all developers can work more freely. Without being limited by which files you can work on, you can work on a feature branch to make changes safely
  6. What is forking?
    Instead of using a single server-side repository to act as the “central” codebase, it gives every developer their own server-side repository. It has been used with BTC for example. The primary code was the bitcoin protocol, then some devs had different ideas, they forked it doing some code on the bitcoin protocol but without effecting the original protocol.
  7. How can we host a website on GitHub Pages?
    Firstly, you will create a repository, then reName it userName.gitHub.io and then .push your code structure.
2 Likes
  • What is the difference between git and github?
    Git is a local version control system, GitHub is a hosting service to manage respositories.

  • What is the staging area?
    The staging area It’s where file version is stored prior to commit

  • What does the -m switch do in git commit?
    The -m switch allows us to enter a commit message within same line of code as the commit.

  • What is the difference between merging and rebasing?
    Merging groups a set of commits together in history.
    Rebasing allows you to access and work on a feature branch and attach to a different commit. Rebase is a linear history of all commits.

  • What does git clone do?
    Git clone copies an existing repository and places that copy in a local directory.

  • What is forking?
    Forking is creating a copy of a repository into your own repository and being able to make changes without affecting the original.

  • How can we host a website on GitHub Pages?
    We can host a website on GitHub Pages by creating a repository username.github.io

2 Likes
  • What is the difference between git and github?
    Git is a version control system that allows your to track updates in your code as you develop. Github is a cloud-based hosting server on which you can host open-source projects.

  • What is the staging area?
    An area within Git where you place files you want to commit to a Git update.

  • What does the -m switch do in git commit?
    it allows you to attach a message to an update.

  • What is the difference between merging and rebasing?
    Merging commits the files to master. Rebasing adds the commit to the end of master.

  • What does git clone do?
    It copies files and puts them in a new folder.

  • What is forking?
    Forking allows you to edit files without losing the original copies of the files.

  • How can we host a website on GitHub Pages?
    We create a repository with our usernames and add.github.io

1 Like
  1. Git: a version control system (VCS) that manages source code history. Git is installed locally; no internet access required.
    Github: a cloud-based service for managing repositories (repos).

  2. The staging area is where we keep changes that we would like to commit to our git repo. Once changes are commited, they are removed from the staging area.

  3. -m stands for message. It allows you to add a message to your commit. A good message on your commits makes it easier to know what edits have been made when looking up code history.

  4. Merging: creating a commit using the latest commits of 2 branches of a git repo.
    Rebasing: takes an earlier commit and " brings it forward " to the end of the master branch. It typically takes longer to execute than merging. But both resolve conflicts.

  5. git clone creates a folder in a new directory and creates a copy of all the files of a git repo.

  6. Forking: a different kind of copy of a repo. For use on MIT licensed repos. It allows you to build on pre-existing code without affecting the original code. It contains the full commit history of the original repo, and keeps its connection with the original repo also.

  7. To host a website on Github Pages: go to the “Settings” on your repo, and change the name of your repo to yourusername.github.io. Then “Github branches” is automatically created in the folder.

3 Likes
  1. What is the difference between git and github?
    Git is a version control system
    GitHub is a hosting service for git repositories

  2. What is the staging area?
    Where files are kept that can be committed to you repository

  3. What does the -m switch do in git commit?
    Allows the creation of a new branch name

  4. What is the difference between merging and rebasing?
    Merging is when two branches are combined into a new single branch
    Rebasing is when a commit is added to the end of the master branch

  5. What does git clone do?
    Copies a repository to a new file

  6. What is forking?
    When a repository is copied and changes are made, but still having a connection to the original source code.

  7. How can we host a website on GitHub Pages?
    By creating a repository, username.github.io and adding a html file

2 Likes