Git notes exercise

1. What is the difference between git and GitHub?

  • Git is a version-tracking software which allows teams to collaborate and contribute code to a project in parallel. The git software is run locally on machines and/or networks where developers can interact with git through the terminal.

  • GitHub is a social platform which integrates with git profiles. GitHub provides tools to developers and teams through using git, and allowing contributors to make push and pull requests to any project, and also make comments in the code etc. The list goes on… GitHub has established itself sort of as the Wikipedia for open-source programs. It is home to millions of open source code bases

2. What is the staging area?
The staging area is the intermediary stage between editing code on the working directory, and committing to production.
A developer will generally work on some piece of code or feature on their machine in the working directory. When they feel it is sufficient to be placed into the review step, they will generally add it to the staging area.
If they are working as a team, this is generally where supervisors or other team members will review and test the code, comment on it, make changes etc. before committing the code live into production.

3. What does the -m switch do in git commit?
The -m switch allows the person who is making the commit to attach a message describing the commit.
This is usually a comment on what has been added in this commit, or a certain feature etc.
The message to proceed the -m switch, as follows:
git commit -m "Added new H1 style to the head of the About Page."
Without the -m switch, you will typically be prompted for a message by a text editor, however the -m bypasses it and automatically appends it to the commit.

4. What is the difference between merging and rebasing?
Both merging and rebasing happen when two paths of development unify into a single branch. This can be done by merging, or rebasing.

Merging happens when an alternative ‘feature’ branch is being developed alongside the ‘main’ branch. There will usually be various commits of both branches along the way before the feature branch is fully functional, tested and ready to go live. When the team decides they’re ready to incorporate the feature into the main branch, they can merge the two branches, retaining the commit history of both, in case of bugs, blames and comments etc.

Rebasing accomplishes much the same thing as merging, but with a small yet impactful difference. When a rebasing takes place, the feature branch begins at the end of the main branch, and all commits made to the main branch are incorporated into the feature branch.

The benefits of merging is that it is much less destructive than rebasing where everything is kept and there can be exhaustive merge commits for the feature branch if the main branch is very active.

While rebasing is more destructive than merging a main branch into a feature branch, rebasing provides a cleaner commit history. The problem with rebasing however, is that the history does not provide context through when upstream changes were incorporated into the feature branch. These rebasing methods are usually best for solo developers and small teams.

5. What does git clone do?
A git clone is when someone ‘forks’ a code repository. When a developer performs git clone, a copy of the subject repository is stored on their computer for them to edit.

6. What is forking?
Forking is the conceptual attribute of cloning: it is taking some existing code base, and changing it. A developer could appreciate many parts and features of a repository, but they think they could do ‘x’ better, or remove ‘y’.
So they clone the repository, make changes to it - and often publish their revised version of the repository.
Their separate version is considered a fork of the original repository.

7. How can we host a website on GitHub Pages?
GitHub allows its users to assign the repository name to your username as a subdomain for github.io, e.g. username.github.io, GitHub will do the rest and have the repository hosted as a website.
Once you do this, GitHub will set up a new gh-pages repository branch for the website.

1 Like

1.) Git is a version control app
Github is a WEb Interface for git --> hosts repositories
2.) A place that stores your commits
3.) You can add a message to your commit
4.) merging: joins multiple histories together --> preserves history
rebasing: reapplies commits ontop of another branch --> rewrites history
5.) create a copy of a branch or repository within a respository
6.) a new project out of another projects copy --> separate Projects
7.) Create a repository and push it to github via version control. Assign a custom domain.

1 Like

.1. What is the difference between git and github?
=> git is the application to work with the online platform github where the files (repositories) are stored
.2. What is the staging area?
=> location to store git add’ed (snapshotted) files. New changes needs a new (snapshot) addition
.3. What does the -m switch do in git commit?
=> adding a (necessary) comment (about this commit)
.4. What is the difference between merging and rebasing?
=> joins commits with keeping history; rebasing joins to annother branch without history
.5. What does git clone do?
=> download the files of the git repository branch to local storage and be able to work with them
.6. What is forking?
=> creating a new git repository filled with a clone of the grid repository
.7. How can we host a website on GitHub Pages?
=> commit to github and access it with “.github.io” to your github username as website

1 Like
  • What is the difference between git and github?
    git is version control, github is an online repository hub
  • What is the staging area?
    a place where files are placed that are ready to commit that can be easily accessed
  • What does the -m switch do in git commit?
    it’s for adding message to the commit
  • What is the difference between merging and rebasing?
    rebasing flattens the history of changes into a line
  • What does git clone do?
    it copies existing the repository
  • What is forking?
    it is a connected copy of repository as is without making change to the original files
  • How can we host a website on GitHub Pages?
    create repository combining the username with “github.io” then push the files/changes to it to publish
1 Like

Hit Notes Exercise Answers

  1. Git is a decentrailzed source control management system where you can track your changes as you develop your website or application. Git hub is a web interface for git, a repository where everyone can store or access repositories assuming they have the correct keys, optionally we can also use github host your web application. In short git is your local repository, and github is a global repository.

  2. The staging area is a concept in git, it contains changes that we want to put into the git repository.

  3. -m switch allows you to attach a mesage to our commit

  4. Merging is when you have two branches and you create a third commit, that has two parents. One being the last commit of the first branch to be merged and the second parent is last commit of the other branch. With a merger you have a history that is not fully linear( left branch and right branch that weve merged). This is great in scenarios where speed is a priority and you desire to solve every conflict at once but done too often can result in a messy tree with a lot of different branches. To solve the issue of messy trees rebasing may make more sense. Rebasing is another way to resolve a conflict giving us the benefit of being able to fully read a linear history, with a clear order of what comes after what, allowing us to track the history of how the master branch developed. When we perform rebase we change the history of our branch

  5. git clone copies a github repository into your local repository.

  6. A fork is a copy of a repository

  7. By going to our settings on gitHub and changing the repository name to our username.github.io

1 Like
  1. 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. If you have open-source projects that use Git, then GitHub is designed to help you better manage them.

  2. What is the staging area?
    Staging area is just a list, or index, that says which files will be committed when a git commit is done, and now the name index is more commonly known as the “staging area”.

  3. What does the -m switch do in git commit?
    a pointer to a specific commit

  4. What is the difference between merging and rebasing?
    Git rebase and merge both integrate changes from one branch into another. Git rebase moves a feature branch into a master. Git merge adds a new commit, preserving the history.

  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.

  7. How can we host a website on GitHub Pages? By copying and pasting to Github.io

1 Like

Git is a distributed control version system and can be used by any computer system.
Github is a free web repository for git repositories and everyone can collaborate each other.

The staging area contains changes that you need to commit into the git repo.

the -m switch allows you to specify some message (text) for the commit in order to track changes in the git repo.

Merge is when you want to unify some branches into one single branch.
Rebasing is when you want to modify the history in linear order (every single change in one line) of that branch or tree. combine all commits into a new commit.

Git clone makes a copy of a git repo into your local computer.

Forking is when you make a copy from the original repo to your personal github account.

When we create a repo called (yourUserName.github.io) we can start pushing files into that repo.

1 Like
  1. Git is a version control system used to track changes to your code projects. Github is a website to share your projects.

  2. The staging area is where your git ‘adds’ are stored before a git commit.

  3. The -m switch allows you to write a message along with the git commit.

  4. Merging and rebasing both handle commits when there are multiple branches. Merging preserves the history of commits by adding new commits. Rebasing combines two branches history into one master branch.

  5. Git clone is used to copy a repository from GitHub onto your computer.

  6. Forking allows you to copy and make changes to a repository without changing the original one.

  7. You can host a website on GitHub pages by forking a repository and naming it username.github.io

1 Like
  1. Git is version control software. Github is where developers can stash their projects (repositories) online.
  2. The Staging Area is comprised of files that have been added (and ready to commit) but not yet committed.
  3. Following the ‘–m’ switch, the author can attach a message to give amplifying information about a particular commit.
  4. Both ‘git rebase’ and ‘git merge’ integrate changes from one branch into another branch.

Merging is “non-destructive”, in that it creates a new “merge commit” in the feature branch and preserves branch history.

Rebasing: Well… Right, rebasing. Um. I’ve read what it does and means. I’m just going to have to use it to answer this question.

  1. If you need to copy a repository onto your local machine, you can use git clone.

  2. Forking starts the brand new history of a project.

  3. Visit pages.github.com and follow their prompt.

1 Like
  1. Git is a version control system, that helps you keep trck of the development of your code while github is a platform to host your git repositories.
  2. Staging area is the “place” where your changed files are stored before commit.
  3. It indicates that there’s going to be a message attached to the commit.
  4. Merging means that you can integrate changes to a target branch, without changing the source branch or the history. When you use rebase a linear history is created, meaning that branches are incorporated together, creating just one branch and deleting all history that’s became pointless during the rebasing.
  5. Clones a repository into a new folder and establishes a connection between the copy and the origin.
  6. Forking is when you copy a repository and continue to work on it (i.e. add new features) without changing anything in the original repo, thus creating basically another version of it.
  7. First we ahve to create a repo, that has a name like this “myusername.github.io”, then we can push the files for the website, into this repo, and we’re ready to go.
1 Like
  1. What is the difference between git and github?
    Git - cloud-based version-control system
    Github - cloud-based repository-hosting service for your code

  2. What is the staging area?
    Where you temporarily hold your code updates/files for the next commit

  3. What does the -m switch do in git commit?
    Allows you to assign a comment/message to the commit

  4. What is the difference between merging and rebasing?
    Merging - allows you to integrate the changes from a select branch and into a single master branch
    Rebasing - allows you to re-arrange/re-write the history of the branches into a linear order

  5. What does git clone do?
    Allows you to make a copy of the source code from a specific branch

  6. What is forking?
    Allows you to get a copy of someone’s repository, subject to open usage license, and utilize it for your own needs. This copy is an independent of the original repository.

  7. How can we host a website on GitHub Pages?
    Create a github account, a repository with your username (username.github.io), and adding an html file

1 Like

NICE WORK!

I just got on the forum here to see when I originally posted on the prompt questions (17 days ago!). I wanted to remark on how dense, grueling and important this video was for me. It’s too easy to turn away from learning Git because building is way more fun. But I can’t shake the anxiety of knowing I’m not actively engaged with my GitHub while I’m building.

Hats off to you. This video was ruthless. And I broke what I was doing ‘I don’t know how many times’.

And to anyone else who hasn’t been able to finish it, I’ll say that you can. Just allow yourself more time than you think is reasonable. LOTS of ‘rewinding’ and paying VERY CAREFUL attention to where Zsolt’s cursor is whizzing.

Whew. Ok. Onward and updward!

1 Like
  1. Git is the version control program, Github is the online platform
  2. Git commit storage area
  3. Attach a message
  4. rebasing adds a commit to the end of the master branch
  5. Clones a repository’s files
  6. A fork copies a repository but it is connected originally to the repository.
  7. By creating a repository named username.github.io
1 Like
  • What is the difference between git and github?
    GIT is a web interface for repositories that anyone can access (if they have the keys for collaboration) and GIT is your repository on your local computer.

  • What is the staging area?
    The staging area is where you add your changed files before committing them to the repository.

  • What does the -m switch do in git commit?
    -m adds a reference message to the commit.

  • What is the difference between merging and rebasing?
    Merge applies each historic change/commit from branch to base branch, whereas rebase applies the changes on top of each other in linear format, as one commit.

  • What does git clone do?
    Cloning copies code from one repository to another, with no further link to the changes that might occur in the repository of origin.

  • What is forking?
    Forking copies code from one repository to another, but keeps a link to the repository of origin.

  • How can we host a website on GitHub Pages?
    From the settings page on the repository you wish to host as a Github page, you simply change the name of the repository to yourUserName.github.io.

1 Like
  1. 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. If you have open-source projects that use Git, then GitHub is designed to help you better manage them.

  2. What is the staging area?
    These files are also referred to as untracked files. Staging area is - files that are going to be a part of the next commit, which lets git know what changes in the file are going to occur for the next commit. The repository contains all of a project’s commits.

  3. What does the -m switch do in git commit?
    use it to switch branches, but also to discard changes and restore files.

  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 main.

  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. The original repository can be located on the local filesystem or on remote machine accessible supported protocols. The git clone command copies an existing Git repository.

  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

  7. How can we host a website on GitHub Pages?
    You need to create an account on GitHub and give this repository a special name to generate your website.

1 Like
  • What is the difference between git and github?
    Git is installed locally and github is the online cloud.
  • What is the staging area?
    The staging area includes files that are going to be part of the next commit.
  • What does the -m switch do in git commit?
    The -m switch allows us to add a comment to our commit.
  • What is the difference between merging and rebasing?
    With merging we can apply changes made in a branch back into our master branch. With rebasing we can shift the origin of our branch to another commit.
  • What does git clone do?
    It copies another repository onto our machine.
  • What is forking?
    With forking we can clone a repository and make changes to it, without affecting the original repository.
  • How can we host a website on GitHub Pages?
    We have to enable it inside our repository under settings > pages.
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?
Files that are going to be a part of the next commit, which lets git know what changes in the file are going to occur for the next commit.

What does the -m switch do in git commit?
Let`s you attach a message to commit.

What is the difference between merging and rebasing?
Merging joins two or more development histories together, rebasing reapplies commits on top of another base branch.

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

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.

How can we host a website on GitHub Pages?
“1. Create a GitHub account on github.com.
2. Download either GitHub for Mac or GitHub for Windows, depending on your operating system. Open the app and log in using the account you just created.
3. Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the “Push to GitHub?” box is checked.
4. Move your website’s files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called “index.html”, and it must exist in the top-level directory.
5. Back in the GitHub application, you should see your files in the left column. Make sure they are all checked. If so, enter a message in the text box called “commit summary”, something like “initial commit.” Then, click the commit button.
6. Click the “Publish repo” button in the top right corner.
7. Give it about 10 minutes, then check your-username.github.io. Your website should be there!”

1 Like
  1. git is the local network for your code while github is the online platform used to showcase on a web server.
  2. The staging area is the place where edits you made to your code are in process of being recorded on your git network. It doesn’t leave this area until you commit to a branch.
  3. -m switch lets you record a message along with your commit to identify what exactly the change entails.
  4. Merging combines a fast forward branch with the master branch to make one timeline of edits while rebasing changes the history of branches to make one complete new master branch.
  5. it copies an existing repository and puts it in a new folder.
  6. A fork is diverge from the master branch to continue on as another project. It is a new project with connection to the first repository.
  7. You can push local repositories to Github pages to host on the online serve using git push. You must also setup through your public key.
1 Like
  • What is the difference between git and github?

Git is a version control system that runs on your machine.allows you to track your changes. Historical backup or snapshot. Allows a team of developers to work together on a project. Interact with git with the command line verses web

GitHub or gitlab —> holds projects in the cloud

interact with GitHub with the web. You can clone or fork projects from GitHub to git them on your machine, and then push them back to GitHub.

  • What is the staging area?

Git is the staging area, because that is the first step to making the changes you want. From there those changes are pushed to GitHub.

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

This flag is used to commit a message to your commit git commit -m “your message”

  • What is the difference between merging and rebasing?

git merge and rebasing solve the same issue.

both integrate changes from one branch into the main branch

Merge commit in the featured branch merges the main

branch to the featured branch

Merging is non-destructive, meaning that the branches are not changed in any way. Later, when upstream changes are made, the history of the project will be difficult to understand

Rebasing moves the entire feature branch to begin on the tip of the main branch, effectively incorporating all of the new commits in main. Instead of using merge commit, rebasing rewrites the project history by creating brand new commits for each commit in the original branch.

Interactive rebasing give you the opportunity to alter commits as they are moved to the new branch. This is even more powerful than an automated rebase, since it offers complete control over the branch’s commit history. Typically, this is used to clean up a messy history before merging a feature branch into a main branch. Golden rule of rebase never rebase a public branch. Never use rebase on a branch if someone else is working on it.

  • What does git clone do?

Git clone makes a clone of the project from GitHub to your computer and allow you to sync between the two.

  • What is forking?

Fork is a copy of a repository which allows you to freely experiment with changes without affecting the original project. Forking is a great way to propose changes to someone else’s project or to use someone else’s project as a starting point for your own idea.

  • How can we host a website on GitHub Pages?

log into GitHub

start a new project and name it your_userName.github.io. create a repository and upload files

Change the readme.md file to index.html. delete the current contents of the file editor and replace them with the HTML of your webpage. Copy/paste. Scroll to the bottom of the page, and commit new file

1 Like
  • What is the difference between git and github?
    git is a distributed version control system to manage and track changes of the working directory history. GitHub is an online git repository service to store the source code resources where users can use git to connect, upload and download for sharing of resources in the remote git repository.

  • What is the staging area?
    Staging area is a working directory where modified or files changes are loading before being commit or push up to the remote git repository. Staging area helps manage and keep tracks of source files changes, whether newly added or modified before commit to the remote repository.

  • What does the -m switch do in git commit?
    The git commit -m switch allows to add messages to provide historical reference about that git commit.

  • What is the difference between merging and rebasing?
    Both merging and rebasing combines changes in 2 branches in their own distinct ways. Merging takes the last commit of source contents of a branch combine with the last commit of the target branch. Only the target branch is updated and the source history remains similar. Rebasing combines changes from the target branch to the tail end of the source branch to a single linear history.

  • What does git clone do?
    git clone makes a local synchronized linked copy project repo from the specified remote git repository project repo.

  • What is forking?
    Forking creates a independent local copy of the git repository project repo.

  • How can we host a website on GitHub Pages?
    Create a public repository in GitHub with the name {username}.github.io (name of your github account) and push the code into the repository with a default landing page. GitHub may takes approx. 10 mins before your website becomes alive.

1 Like