Git notes exercise

1. What is the difference between git and github?
Git is an open-source, version control tool created in 2005 by developers working on the Linux operating system; GitHub is a company founded in 2008 that makes tools which integrate with git.

2. What is the staging area?
The staging area 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).

3. What does the -m switch do in git commit?
This allows you to attach a message to the commit.

4. What is the difference between merging and rebasing?
Merging is a safe option that preserves the entire history of your repository, while rebasing creates a linear history by moving your feature branch onto the tip of master.

5. What does git clone do?
git clone is primarily used to point to an existing repo and make a clone or copy of that repo at in a new directory, at another location.

6. What is forking?
A fork is a copy of a repository. Forking a repository allows you to freely experiment with changes without affecting the original project. Most commonly, forks are used to either propose changes to someone else’s project or to use someone else’s project as a starting point for your own idea.

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

  1. Head over to GitHub and create a new repository named username .github.io, where username is your username (or organization name) on GitHub.
  2. Go to the folder where you want to store your project, and clone the new repository.
  3. Enter the project folder and add an index.html file.
  4. Add, commit, and push your changes.
  5. Fire up a browser and go to https:// username .github.io .
3 Likes
  1. Git is a version control system. Github is a web app to store repositories

  2. Files which are going to be a part of the next commit

  3. It allows us to specify a commit message

  4. Merging takes files from source brance and integrates with target branch. Rebasing compresses all the files into a single branch.

  5. Git clone creates a copy of the repository on local machine

  6. Forking creates a copy of the original repository without affecting the original repository

  7. You can host a website on github by making a repo with our username after .github.io

2 Likes
  1. git is a version control protocol for code where github is a website that uses the git protocol to store users code online.

  2. The place where changes are stored in git in preparation for the next commit.

  3. It allows you to leave a message to your commit.

4.git merge preserves the complete history and maintains the context of the branch while git rebase streamlines the commit history.

  1. git clone allows you to copy a specified repository to your location.

  2. forking is creating a copy of a repository to your account so you can develop without effecting the main project code.

  3. rename the relevant repository you would like hosted to .github.io

3 Likes
  1. Git is a version control system. Github is a cloud-based service for managing repositories.

  2. A space where you can store your git commits.

  3. The -m in git commit allows to specify the commit message.

4.Merging will incorporates the changes of the commits in the current branch. Rebasing adds a commit at the end of the master branch. Allows us to fully read a linear history.

5.The clone creates copy of an existing repository in a new directory locally on your machine.

6.A fork is a copy of the original repository(upstream repository) this repository stays on your github account.

7.Creating a repository -> push the code to the repository -> settings -> source choose master branch -> save changes -> press the url showing.

2 Likes

1. What is the difference between git and github?
git is a version control system wich means that this program tracks every change you made in a file and stores when, where and why someone made a change. Github is a platfrom where people can host and collaborate on git repositories.

2. What is the staging area?
when files are in the staging area you are letting the computer know you want to track those files for the commitment you are going to do next. And you can also track what you did in the past.

3. What does the -m switch do in git commit?
this -m makes it possible to give a commit a little message. This way you can save what you have commited/changed about the files you or other people are working on. Then this change get saved as a new version of the file you were working on.

4. What is the difference between merging and rebasing?
with merging you join the branches together, wich creates a forked and then merged timeline.
And with rebasing you add one branch on top of the other so it overwrites the code.

5. What does git clone do?
with git clone you can copy-paste a whole project into your own repository.

6. What is forking?
when you fork the code you basically copie the code and make it your own without doing a lot of work this way we can speed up the programming process.

7. How can we host a website on GitHub Pages?
if you want to do this you have to make a repository named username.github.io and here you put in the code you wanna use for the website.

2 Likes

Git - decentralized source control management system where you can track your changes as you develop websites or apps.
GitHub -

Staging Area - contains changes we want to commit to git repository

-m switch - the commit message that everyone will see attached to your commit.

Merging - ties together histories of both branches without changing the existing branches
Rebasing - moves the entire feature branch to begin at the tip of the master branch. It rewrites project history by making new commits

Git clone - Git command line utility which is used to target an existing repository and create a clone, or copy of the target repository

Forking - Git clone operation executed on a server copy of a projects repository

Host a website - create a repository with an html file and host a URL with username. github. io

1 Like
  • What is the difference between git and github?
    Git is a version control system that lets you manage and keep track of your source code history. GitHub is a cloud-based hosting service that lets you manage Git repositories.

  • What is the staging area?
    The staging area 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)

  • What does the -m switch do in git commit?
    Let you add a comment to the commit. Best practise is to have one comment for every changes

  • What is the difference between merging and rebasing?
    Git rebase and merge both integrate changes from one branch into another. Where they differ is how it’s done. Git rebase moves a feature branch into a master. Git merge adds a new commit, preserving the history

  • What does git clone do?
    The git clone command copies an existing Git repository. git clone is primarily used to point to an existing repo and make a clone or copy of that repo at in a new directory, at another location. The original repository can be located on the local filesystem or on remote machine accessible supported protocols.

  • What is forking?
    Forking is a git clone operation executed on a server copy of a projects repo.
    When you fork a repository, you create a copy of the original repository (upstream repository) but the repository remains on your GitHub account. Whereas, when you clone a repository, the repository is copied on to your local machine with the help of Git

  • How can we host a website on GitHub Pages?
    Creating a github repository with the username+github.io. Populate the repository with website material. Enjoy your new website at https://username.github.io

1 Like
  1. Git is a tool used in the command line to keep track of all the changes made to a project as well as upload them these changes.
    Github is a remote server that is used to create and build projects. It is designed to incporporate collaboration between developers.

  2. The staging area is where changes made in the code are stored (and viewed) before being comitted.

  3. It let’s you write a header for a commit.

  4. They both acheive the goal of combining code from seperate trees. Where in merging all the commits are merged into a tree at once, rebasing merges commits indiviually inserting them in the main branch at the time they were committed. This creates a linear line as opposed to a tree-like depiction of merge.

  5. It copies code that can get re-created in, for example, your terminal.

  6. Forking is where a project splits into two paths. There is a shared history up to the point where the fork happens.

  7. Create an account, look for the green button that creates a new repository and start coding.

2 Likes

1 - Git is a decentralised modern version control system allowing programmers to track changes to their code, whereas, github is a web interface that allows us to host our git repositories.
2 - The staging area allows us to store any changes that are to be committed.
3 - -m switch allows us to comment a message that gives a short description of what changes are to be committed.
4 - Merging takes the code that is found on the feature brances and merges it with the master branch. Rebasing takes the feature branch and appends it to the tip of the master branch.
5 - Git clone is used to target an existing repository and create a clone of this repository.
6 - Forking allows for repositories to be cloned, but any changes made to these cloned copies do not affect the original project.
7 - Create a new repository that is named github username .github.io. This will also be the URL of the github site.

2 Likes
  1. git is a Decentralized Source Control Management System that is local, installed on your computer. You can access and work off-line anytime, anywhere; Githum is a web interface that everyone can access; you upload or push your repositories and projects there for collaboration with other developers.

  2. Staging area: Changed that are made to files in your repository are then added with the git add . command. They are in the staging area waiting to be committed to the git.

  3. The -m in a commit command is the descriptive message of that commit.

  4. Merging - is updating a branch with the latest changes of master branch; conflict will need to be resolved; this produces a commit with 2 parent branches, a master and a feature; creates a history that is not fully linear; it can get messy if done too many times

Rebase - takes longer than merge; it gives more info and is bulletproof; don’t need to commit, a linear history that can be view in log --oneline

  1. git clone - creates a copy of a repository to local platform

  2. forking - is when you link your repository to a public repository that contains a project/files

  3. we can host a website by cloning, forking or downloading a repository address into our github repository

2 Likes

What is the difference between git and github?
Git is a version control system that allows developers to work on projects together simultaneously and helps to keep collaboration more organized and efficient. Github is a website that hosts git repositories.
What is the staging area?
The staging area is an intermediary between the local working directory, and the repository that everyone sees. This allows code to be audited before pushing it into the master version. The staging area is used with the command: git add
What does the -m switch do in git commit?
-m allows you to provide a message to go along with your git commit.
What is the difference between merging and rebasing?
‘Merging’ merges your local branch with the master branch. Other branches’ change history are still intact. Rebasing takes all of the master branches’ commits and puts them on the tip of your branch’s commit history, as if it were one single chain of commits. This eliminates the branch-like history of the master, but it will not incorporate other developers’ commits that are being worked on at the same time as you. When they go to commit their new changes, it will be under the context of the old master and create a new, unnecessary branch.
What does git clone do?
git clone [url] makes a local copy of the linked repository.
What is forking?
Forking is when you take existing code and add to/modify it, creating a new and different software. In git, forking makes a copy not locally, but rather only on your github account.
How can we host a website on GitHub Pages?
We simply rename the repository we wish to host to "{username].github.io

2 Likes

1. What is the difference between git and github?
Git is a version control system that allows you to track changes in code. Github is the web interface platform that allows you to post your repositories in the cloud.
2. What is the staging area?
The staging area is the area where you can store git commits and retrieve them at will.
3. What does the -m switch do in git commit?
The -m switch in git commit allows you to attach a message to the commit you are entering.
4. What is the difference between merging and rebasing?
Rebasing can be destructive and allows you to alter the commit history while merging is non-destructive and monitors the history of all branches.
5. What does git clone do?
Git clone creates a copy of the current repository into a new directory.
6. What is forking?
A fork is a copy of a project that is put in your repository. This allows you to experiment with different changes without modifying the original project.
7. How can we host a website on GitHub Pages?
The way to host a website on GitHub pages is by creating a repository titled username.github.io and adding a HTML file as well.

2 Likes
  1. Git - decentralized source control management system, where you can track changes. GitHub - is the single largest host for Git repositories.

  2. Staging area - contains some changes that can be committed into the Git repository.

  3. git commit -m "message" ‘-m’ allows us to attach a message to a commit.

  4. Merging - is when you have 2 branches and you combine them together. Merging creates a special commit that has 2 unique parents.
    Rebasing - it is used to create linear history in a clear order. It shows what comes after what.

  5. Clone - when a repository is copied from GitHub to a local computer.

  6. Fork - when a personal copy of someone else’s project is produced.

  7. In settings a repository name can be changed to a link for example user_name.github.io

2 Likes
  1. What is the difference between git and github?
    Git is a decentralised system of controlling the different versions of a piece of work.
    Github is an online service that manages the Git repositories.

  2. What is the staging area?
    The staging area is where the files that are going to be committed to git are held.

  3. What does the -m switch do in git commit?
    It allows us to add a message when files are being committed for reference.

  4. What is the difference between merging and rebasing?
    Merging is where branches are kept in a non-destructive manner so all changes can be tracked which can become complicated. Branches can be combined (merged) where necessary.
    Rebasing is a destructive method of tracking changes that combines all changes and merges the branches into a single history.

  5. What does git clone do?
    Creates a copy of another repository at the location you choose.

  6. What is forking?
    Forking creates a copy of a repository that is then adjacent to the original repository. The forked project can have changes made to it without affecting the original. The fork has a link to the original project whereas a clone does not.

  7. How can we host a website on GitHub Pages?
    We can create a repository with a name that ties in your github username. You add “github.io” to the end of the domain and then push the changes through.

2 Likes
  1. What is the difference between git and github?
    Git is decentralized source control management system, where you can track your changes when you develop websites or applications or other projects.
    GitHub is a web interface for git, where you can store your repositories and files like javascript.

  2. What is the staging area?
    Staging area contain some changes that you would like to commit into the git repository, those files are stored and retrievable.

  3. What does the -m switch do in git commit?
    It allows us to add a message to a commit

  4. What is the difference between merging and rebasing?
    Merging is when you have 2 branches and you create a third commit, that has 2 parents, one is the last commit of the 1st branch to be merged, the 2nd is the last commit of the other branch.
    in case of a merge situation, you have a history that is not fully linear, with a branch from the right and a branch from the left, and these 2 branches are merged, it’s good if you want to do something fast like a merge of 2 long histories, but if you have so many branches it will become mass, so in this case rebasing is more convenient, it’s the other way to resolve a conflict, where you can have fully read
    of a linear history and you have every single change in 1 line, and you have a clear order of what comes after what. Rebasing also changes the history of the branch.

  5. What does git clone do?
    git clone can copy projects to the repository.

  6. What is forking?
    It is a copy of a repository. It allows you to experiment with changes without affecting the original project.

  7. How can we host a website on GitHub Pages?
    By creating a new repository name username.github.io then clone the new repository and add an html file.

2 Likes
  • What is the difference between git and github?

GitHub is an online platform where one can host git repositories. Git is the application for version control of the git repositories.

  • What is the staging area?

with git add . or git add filename we can add a file to the staging area. This area keeps a “backup” of the added file, and allows us to retrieve them if needed. If further changes happen, the staged file is not changed, and the updated version has to be added first.

  • What does the -m switch do in git commit?

-m allows to attach additional information to the commit, so that other can find our changes immediately. For example git commit -m "updated index.html header class style"

  • What is the difference between merging and rebasing?

By merging we keep track of the history of all branches involved, without altering their commit history. Rebasing takes a side branch and move it to the end of f.e. the master branch, or any other given branch.

  • What does git clone do?

git clone let’s us clone a repository for our own uses.

  • What is forking?

Forking let’s us copy a project and start working on it without being directly connected to this repo. Our changes will not affect the original. It is almost like a fork in a blockchain.

  • How can we host a website on GitHub Pages?

We can launch a repo on github Pages by changing the repository name to https://ourusername.github.io. Of course, we need an index.html as a landing page.

2 Likes
  1. Git is a version control system. This essentially allows for you to maintain a track record of your code and progress. Github happens to be a hosting service for git repositories. This can allow for multiple people to work on code at once.
  2. The stage area is where you can place updates for them to be reviewed before actually fully committing the code.
    3.The -m switch allows for you to write a message with regards to the content of the commit. These allows for you to write notes for others to better understand your commits.
  3. Merging allows for you to combine to branches of code (merge them). This does not destroy previous commit history. Rebasing however takes a branch and restructures it under the master branch. This allows for users to then alter commit history contrary to that of merging.
  4. Git clone allows for you to clone the repository on to your local computer. This allows for you to work on the code while not making any changes to the remote repository.
  5. Forking is similar to the git clone function except the copy becomes completely independent of that of the original code. You can then use the code and do as you please with it.
  6. You can host a website by creating your own repository on git hub. You do this on yourUsername.github.io There you can add files of your code.
2 Likes
  1. Git is a offline version control system and github is an online code-sharing service.
  2. The staging area is where changes can be formatted and reviewed before completing the commit.
  3. It allows you to add a message to the commit.
  4. Merging is when you integrate the source branch into the target branch and rebasing is when you integrate the changes into a single branch and then integrate it to the target branch.
  5. git clone clones a repository to your current folder.
  6. When a project gets cloned and used for another project
  7. By creating a github repo and an orphan branch where you put all of your website files in.
2 Likes
  1. Git is the programming system (app, severs, shell etc.) you are working on/creating from your computer. Git hub is the website that is connected to the git application on your computer. Git can interact with Git Hub for collaboration with other programmers.

  2. The staging area is the files you are presently working on. The changes made in the staging area do not affect the source file. Files in the staging area are versions/copies of the source file. When one is satisfied with the changes made, one can commit the new files/changes to the source file. When committing changes to the source file, the source file is not rewritten or replaced - rather, the newly committed files become the source files and the old source file is kept but not used as the source file. This way all stages and history of development are kept track of and can be brought to the staging area to be worked on or re-worked on.

  3. -m let’s you attach a message/note to your commits

  4. Merging joins branches together to make a single branch. Rebasing rewrites an older stage thus keeping a linear timeline

  5. Git clone is taking the code form a git hub repository and importing it into your own git

  6. Forking is taking the code from someone’s git hub repository and hosting it in one’s own git hub repository

  7. You can host a website on github by creating a github repository for your site and then setting the domain of that repo to yourgithubusername.github.io

2 Likes
  1. What is the difference between git and github?
    Git is used to track changes to your code as you develop so you can go back in time if you need to. Github is a website that hosts your git commits.

  2. What is the staging area?
    the staging area is where your commits are stored and retrieved from

  3. What does the -m switch do in git commit?
    allows you to add messages to your commits so you can quickly understand what you did

  4. What is the difference between merging and rebasing?
    merging merges commits in the current branch. rebasing overwrites one branch on another.

  5. What does git clone do?
    makes a copy of a repository onto your local machine

  6. What is forking?
    makes an exact duplicate of a project, changes in the fork do not affect the main project.

  7. How can we host a website on GitHub Pages?
    create a repository username.github.io then add index.html into it.

2 Likes