Git notes exercise

Exercise

After watching the video(s), answer the following questions, and post your answers below:

  1. What is the difference between git and github?
  2. What is the staging area?
  3. What does the -m switch do in git commit?
  4. What is the difference between merging and rebasing?
  5. What does git clone do?
  6. What is forking?
  7. How can we host a website on GitHub Pages?
7 Likes
What is the difference between git and github?

Git is the version control application, where github is an online platform that hosts git repositories.

What is the staging area?
  • A snapshot of files ready commit
  • If a staged file is modified after it its staged those changes are not “staged” and would need to be re-added to be included in the commit
What does the -m switch do in git commit?

Gives the ability to attach a message to the commit

What is the difference between merging and rebasing?

Bebasing replays the changes in on the side branch into the main branch in the order they occurred. The end result is the same, but the history is flattened into a line as if all the changes happened on the main branch.

What does git clone do?

Creates a copy of another repository at the current location.

What is forking?

Forking is creating a new project starting from a copy of another project. Changes pushed to the forked copy do not get added to the original. Both projects will continue separately from that point.

How can we host a website on GitHub Pages?

https://pages.github.com/

  1. Create a new repo with a name that combines your github username and “github.io
  2. Copy the website files to the new repo and push the changes
2 Likes
  • What is the difference between git and github?

Git is the version controll that let`s you keep track of your code as you develope, saves your code if you mess up. Github is a cloud based server to serve your code to the web.

  • What is the staging area?

A space where you can store your git commits and retrieve them if needed.

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

  • What is the difference between merging and rebasing?
    When you merge you add the commit to the master branch and only change the master branch. When rebasing you add the commit to the end of the master branch.

  • What does git clone do?
    It copies an excisting repository or code files to a new folder

  • What is forking?
    A fork is to copy a repository and change it without affecting the original source code. The difference between a fork and a clone is that the fork has a connection to the original depository.

  • How can we host a website on GitHub Pages?
    We can push our website to GitHub using version controll and also assign a custom domain.

2 Likes

1. What is the difference between git and github?
[spoiler]Git is a version control system—essentially a tool to keep track of your source code; whereas, GitHub is a hosting service for Git repositories.[/spoiler]

2. What is the staging area?
[spoiler]The staging area is a standby area where you can look over your work before actually committing code to a repository.[/spoiler]

3. What does the -m switch do in git commit?
[spoiler]The “-m” switch allows you to type in a message regarding what you’re committing to the repository. The messages you type makes it easier for you or others to track changes made.[/spoiler]

4. What is the difference between merging and rebasing?
[spoiler]Merging keeps track of the history of all branches involved and is non-destructive; whereas, rebasing takes the feature branch and moves it to the end of the master branch. Rebasing can be destructive as it permits the user to alter the commit history.[/spoiler]

5. What does git clone do?
[spoiler]Git clone takes a snapshot of the repository and creates a second instance of it on the user’s local machine. This allows the user to modify the code without affecting the remote repository.[/spoiler]

6. What is forking?
[spoiler]Forking is similar to cloning; however, forking allows the user to make changes and submit a pull request to the repo owner to integrate on GitHub. If the user does not have write access to the forked repo, integrating is not possible.[/spoiler]

7. How can we host a website on GitHub Pages?
[spoiler]We can host a website on GitHub Pages by creating a repo with your username followed by .github.io[/spoiler]

.

3 Likes
  1. What is the difference between git and github?
    Git is a version control application. Github is a web service that store repositories.

  2. What is the staging area?
    It’s the files under version monitoring but not committed yet.

  3. What does the -m switch do in git commit?
    the -m in git commit allows to specify the commit message.

  4. What is the difference between merging and rebasing?
    Merging will incorporates the changes of the commits in the current branch. Rebasing will ‘transplantate’ a topic branch on another.

  5. What does git clone do?
    Git clone do a copy of a repository.

  6. What is forking?
    Forking allows to start a new project from a copy of a repo without connection (i.e. changes in the fork will not affect the original branch).

  7. How can we host a website on GitHub Pages?
    We can host a website on github creating a repository with a name following this pattern : https:// username .github.io and a file : index.html

2 Likes

What is the staging area?

Staging area is files which are going to be part of the next commit, this staging area let’s git understand what changes in the file going to occur for the next commit.

What does the -m switch do in git commit?

“-m” allows you to type a message to your commit for reference.

What is the difference between merging and rebasing?

Merging takes the contents of a source branch and integrates with the target branch. In this process only the target branch is changed. The source branch history remains the same. Rebasing compresses all the changes into a single “patch”. Then it integrates the patch onto the target branch. In this process unwanted history is eliminated.

What does git clone do?

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

What is forking?

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

How can we host a website on GitHub Pages?

Creating a repository -> push the code to the repository -> settings -> source choose master branch -> save changes -> press the url showing and enjoy your website!

1 Like
  1. What is the difference between git and github?
  • Git is decentralized source control management system where you can track your changes as you develop your website or web applications.
  • GitHub is a web interface for git. It’s where we repositories and allows us to host websites.
  1. What is the staging area?

The staging area contains changes that you want to commit into the git repository. They will be stored and retrievable.

  1. What does the -m switch do in git commit?
    -m switch
    Attached a message for the commit.

  2. What is the difference between merging and rebasing?

  • Merging is when you have 2 branches and you create a 3rd commit that has 2 parents. 1 is the last commit of the 1st branch to be merged and the other is the last commit of the other branch.

  • Rebasing adds a commit at the end of the master branch. Allows us to fully read a linear history.

  1. What does git clone do?
  • Cloning is when you copy a repository or files to a new folder.
  1. What is forking?
  • Forking is a copy of a project which will be hosted under your repository. This continues to have a connection with the original depository.
  1. How can we host a website on GitHub Pages?
    Creating a repository with html file and pass a url.
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 files that are going to be part of the next commit

What does the -m switch do in git commit?
It lets you attach a message to your commit for reference

What is the difference between merging and rebasing?
When you do rebase a feature branch onto master, you move the base of the feature branch to master branch’s ending point.
Merging takes the contents of the feature branch and integrates it with the master branch. As a result, only the master branch is changed. The feature branch history remains same.

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 repo. It allows you to freely experiment with changes without affecting the original project.

How can we host a website on GitHub Pages?
You can host a website on github by creating a repo with your username followed by .github.io

1 Like

1 Like
  1. Git is a version control system, whereas GitHub is a platform for hosting and collaborating on git repositories

  2. The staging area is where modified files are kept before being committed

  3. The -m switch allows a message to be added to a commit

  4. Merging integrates changes from branch into master, rebasing moves the base of the branch to the master ending point

  5. Git clone creates a local copy of a repository

  6. A fork is a copy of a repository that is independent of the original repository

  7. We can host a website on GitHub Pages by creating a repository username.github.io and adding an html file

3 Likes
  1. Git is a version control system that you can install locally on your system which will be able to manage the history and changes of your edits. GitHub is an online platform where these changes will be uploaded allowing you to include contributors to the work.

  2. The staging area is where you keep the files that you are ready to commit towards the project.

  3. The -m switch will allow you to move to a branch and it’s the new syntax adopted after the original “checkout” command. It allows you to switch your current HEAD branch. The -m is to add a message to commits.

  4. Merging is unifying the desired branches into one single branch. You can merge any branch with any other branch. Rebasing is when you go back in history and re-write the history of that branch or tree. It is the process of moving or combining a sequence of commits to a new base commit. Rebasing is most useful and easily visualised in the context of a feature branching workflow.

  5. Cloning allows you to target and copy the code from an existing repository and create a clone of that repository.

  6. Forking is copying someone else’s code in a repository that is subject to MIT license (open usage license) and employ it for your own coding purposes allowing you to make changes to the code tailored to your own needs.

  7. by creating an account and repository on GitHub and adding an HTML file. You can update the code’s versions by using the push command from the bash terminal.

2 Likes

1.The difference between Git and Github are,… First, Github is not a substitute for Git. Git is a decentralized source control management system for tracking changes while developing websites or web applications. Github is an interface for Git.

  1. The Staging Area, contains changes that we would like to commit into the Git Repository. Files in the Repository are stored and can be retrieved.

  2. The -m switch creates a new branch name

  3. Merging is when you have two branches and you create a third commit that has two parents, one is the last commit, of the first branch to be merged and the second is the last commit of the other branch.
    Rebase however is another way of resolving a conflict. Rebasing allows to fully read a linear history (every single change is one line) and have a clear order of what comes after what.

  4. Git clone makes a copy of the original.

  5. Forking is basically making a copy from which we can make edits

  6. we can host a website on Github by copying and pasting to Github.io and the rest is done in Github

2 Likes

1.The difference between Git and Github are,… First, Github is not a substitute for Git. Git is a decentralized source control management system for tracking changes while developing websites or web applications. Github is an interface for Git.

  1. The Staging Area, contains changes that we would like to commit into the Git Repository. Files in the Repository are stored and can be retrieved.
  2. The -m switch creates a new branch name
  3. Merging is when you have two branches and you create a third commit that has two parents, one is the last commit, of the first branch to be merged and the second is the last commit of the other branch.
    Rebase however is another way of resolving a conflict. Rebasing allows to fully read a linear history (every single change is one line) and have a clear order of what comes after what.
  4. Git clone makes a copy of the original.
  5. Forking is basically making a copy from which we can make edits
  6. we can host a website on Github by copying and pasting to Github.io and the rest is done in Github
2 Likes
  • What is the difference between git and github?
    git is an open source version control software. Github is just a UI for git.

  • What is the staging area?
    The staging area contains changes that have no yet been committed to the github repository

  • What does the -m switch do in git commit?
    this creates a new branch name when making a commit

  • What is the difference between merging and rebasing?
    merging unifies two branches into one single branch. rebasing re-writes the history in linear order and combines into one commit.

  • What does git clone do?
    creates a clone(copy) of a repository for you.

  • What is forking?
    Forking is copying someone else’s code in a repository that is subject to MIT license (open usage license) and employ it for your own coding purposes allowing you to make changes to the code tailored to your own needs.

  • How can we host a website on GitHub Pages?
    we can host a website on Github by copying and pasting to Github.io and the rest is done in Github

1 Like

Git is a version control system to keep track of your source code history.
GitHub is a hosting service that lets you manage Git repositories.

The staging area, is where files are going to be a part of your next commit.

-m lets you write a message to your commit.

Merging is used to merge one or more branches into the branch you have checked out.
Rebasing allows developers to integrate changes from one branch to another.

Creates a copy of a repository.

Forking is when developers take a copy of source code from one software package and start independent development on it.

On Github pages by creating a repository with a name https:// username .github.io.

1 Like
  1. What is the difference between git and github?
    git is the command, github is remote repo you can push changes to and where others can access.

  2. What is the staging area?
    files that have been added but not commited yet

  3. What does the -m switch do in git commit?
    lets you make a comment on the command line instead of waiting for the editor to popup and creating a multi line comment.

  4. What is the difference between merging and rebasing?
    merging just merging the code in and has a bad effect on the log entries. you are mergin the changes you made and the change some else made after you pulled latest code down.
    rebaseing is where you make sure the starting point on the local machine is the same as it would be if you just did a pull of the remote repo. This way when you push your changes only your changes are being merged in. The log history is also more understandable because it only includes your changes.

you should all ways update your system before you push so you can fix any problems make sure it still works before pushing to the remote. (then you can avoid having to merge/rebase)

  1. What does git clone do?
    git clone copies the entire repo to your local machine (hall the history everything) if the remote ever get distroyed any clone copy can be used to restore the whole thing.

  2. What is forking?
    foring is when you clone a project and then change the remote repo to create a new project like bitcoin cash did. This happens a lot in open software projects. if some one wants to go in a new direction they can fork the git repo because they wont be merging back into the main branch. (FORK the BANKS!!)

  3. How can we host a website on GitHub Pages?
    This can be done easy for a static web pages, or books. need to create the pages and then push them to the github repo and put links in the readme.md file so when you click on the link the browser comes up and servers the html file. (works as long as you are using static pages).

web sites running on a regular server could under source code control using git and doing a git check out to the servers web directory can create new version of the website. This is a good idea to use source code control on a website. You can use difference tools to see if any thing was change on the website.

1 Like

hi @zsolt-nagy - would you mind sharing the settings you are using in your bash_profile terminal? like the color and the directory displayed on the first line… attached…

thanks!

1 Like

It’s called Git Bash (gitforwindows.org). There is no bash_profile involved, it just looks like Linux, but it’s a Windows terminal.

1 Like

What is the difference between git and github?

Git is the version control software. Github is the location where the repositories are stored.

What is the staging area?

Where files that will be committed are stored prior to them being committed to the git.

What does the -m switch do in git commit?

Attaches a message to a commit.

What is the difference between merging and rebasing?

merging creates a branch that is made up of the last commits from 2 other branches.
Rebasing rearranges the history of the branches on the tree so that everything flows linearly

What does git clone do?

git clone makes a copy of another repository

What is forking?

taking a copy of open source code and changing the code how you want.

How can we host a website on GitHub Pages?

create a repository on github named username.github.io containing a HTML file

1 Like
  • What is the difference between git and github?
    Git is a version control system where you can track the changes overtime in your source code. Github is a web interface hosted in cloud that lets you mange git repositories.

  • What is the staging area?
    The staging area is where files are kept before being commited.

  • What does the -m switch do in git commit?
    Creates a new branche.

  • What is the difference between merging and rebasing?
    Merging unifies two branches into one single branch wheres rebasing re-write history in a linear order (every single change is one line); combine a sequence of commits into a new commit.

  • What does git clone do?
    Git clone makes a copy of source code that exists in a branch.

  • What is forking?
    Forking is a copy of source code from another user, and you continue developed it to your own needs.

  • How can we host a website on GitHub Pages?
    By create an repository in GitHub with a name https:// username .github.io.

1 Like