Git notes exercise

What is the staging area?]
If you think of it like you were moving furniture for a house then the staging area is inside the box and when you add things to the box (git add) then they are in the staging area. then you can add a commit to the changes with a message or a label on the box.

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 is a non-destructive operation. The existing branches are not changed in any way, merging ties together the histories of both branches, giving you a branch structure.
REBASING: has the potential to rewrite the commits. As an alternative to merging, you can rebase the feature branch onto master branch This moves the entire feature branch to begin on the tip of the master branch, effectively incorporating all of the new commits in master . But, instead of using a merge commit, rebasing re-writes the project history by creating brand new commits for each commit in the original branch.

What does git clone do?

Git clone creates a copy of a repository in a local directory on your computer
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. The user is then free to use this repository either for their purpose or experiment with changes in the code.

How can we host a website on GitHub Pages?

We can host a website on github by making a repository with named : Username.github.io

2 Likes
  1. 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. 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 .

  3. Gives the the ability to attach a message to the commit

  4. -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.
    -Merging adds a new commit to your history.
    -Merging is recommended when working in a team, rebase makes more sense for individuals.

  5. Creates a copy of another repository at the current location.

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

  7. https://pages.github.com/

  8. Create a new repo with a name that combines your github username and “github.io

  9. Copy the website files to the new repo and push the changes

2 Likes

1: git is a working version control system and github is the cloud hosting that acts as it’s server.
2: The staging area is a working area where you look at the code you are developing before adding the code to a hosting repository.
3:The - m switch allows you to add a message saying what you are in fact committing to the repository.
4:Merging will add the changes of the commits in your working branch , while rebasing will transplant a branch to another main target branch
5:git clone creates a copy of an existing repository into a new directory.
6:Forking is a copy of a project hosted with your repository; yet still connected to the original depository.
7: To host a website create a repository with html, username and github.io URL at the end.

2 Likes

Git notes exercise

Question 1
Git is an open source, decentralized, distributed version-control system. Github, on the other hand, is a platform for hosting and collaborating on Git repositories. (Source: https://training.github.com/downloads/github-git-cheat-sheet/)

Question 2
The staging area is the area on the left-hand side of Visual Studio code that contains the changes we would like to commit into the Git repository.

Question 3
The -m switch in git commit commits a file to the repository and removes it from the staging area, indicating that there have not been any changes to the file.

Question 4
Merging is the process of using two parent branches to create a third. Like merging, rebasing helps to resolve conflicts. However, it helps to rewrite the history of the changes shown in the staging area. Merging resolves the conflict of two end states, but rebasing requires resolving the conflict multiple times, which, I’m sure, can be exhausting.

Question 5
Git clone copies repository files to a new folder. It affects only your own repository; it doesn’t affect anyone else’s.

Question 6
Forking is copying your own project to another individual’s project without affecting the source code.

Question 7
We can host a website on GitHub Pages by creating an html file and a repository known by our username.

Thanks!

2 Likes

Q: What is the difference between git and github?

A: Git is a version control that lets you keep track of history. Github is a server in which you can share code or projects on the web.

Q: What is the staging area?

A: The staging area have files and changes that are going to commit.

Q: What does the -m switch do in git commit?

A: With the -m switch you can add a comment to your commit.

Q: What is the difference between merging and rebasing?

A: With merging a branch get created from the two last commits of 2 other branches. On the other hand, rebasing lets you commits or a sequence of them to a new commit in a linear way.

Q: What does git clone do?

A: Copies a code that is in a branch.

Q: What is forking?

A: Getting a copy from an original project that is made public. After changing the code of the fork it will not indicate the original one.

Q: How can we host a website on GitHub Pages?

A: By changing the name of the respiratory in settings: username.github.io

2 Likes

1. What is the difference between git and github?
Git is the version control that is open source and decentralized. Github is the platform that hosts Git repositories

2. What is the staging area?
The staging area (on the left of VS code by default) contains the work that we would commit (before committing) to the Git repository.

3. What does the -m switch do in git commit?
Allows the developer to attach messages to the committed file for ease of access for self and other developers

4. What is the difference between merging and rebasing?
Merging a side branch to a master branch will incorporate the changes made in the side branch to the master branch. This changes only the master branch and keeps the history of the side branch intact.
Rebasing functions the same, but the side branch will be wiped out. This removes the history of changes made, saves space but the change history is eliminated.

5. What does git clone do?
Clones or copies a repository to a new folder or directory on your local computer. The source can be from the web or locally from a different repository

6. What is forking?
Forking is a method used to attach a project to an original project without affecting the original repository. I think that this is a common term in blockchain when there are updates like soft forks and hard forks.

7. How can we host a website on GitHub Pages?
Create a repository (with your code and an HTML file). Use your username to label said repository and attach .github.io (e.g. myAccount.github.io)

Edit: The link mentioned above is fake, didn’t know that will auto-update as a link, sorry :v:

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

Git is a system used to track changes to normal code.

GitHub is a platform that uses git’s code tracking features. Then it adds a visual front end and allows users of the platform to collaborate on projects that are tracked using git.

  • What is the staging area?

Files waiting to be committed to the branch.

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

-m Means message can be added to commit so that there is a comment about changes that took place.

  • What is the difference between merging and rebasing?

A merge has two parent branches and brings them together

Rebasing makes a linear history and not a railway station (a great way to remember)

  • What does git clone do?

It makes a clone of existing code. This is how you copy open source code for use in your projects.

  • What is forking?

Forking is generally when your looking to make a modified version of the original code. Lite coin is a great example of forked code.

  • How can we host a website on GitHub Pages?

Create repo with (user.github.io

1 Like
  1. git is a software tool used by individual developers to manage source code changes. Github is an online repository that you can use to push your code to, and to let others work with your code.

  2. The staging area is for files you have been working on and asked git to track by using git add. When you do a commit, the changes from the staging area are saved into a commit.

  3. It is the message flag, you should include a message after it describing the changes contained in the commit.

  4. Merging and re-basing both achieve the same thing but in very different ways. Merging is non-destructive, but does create an additional commit in the feature branch for any commits in the master branch so it can be confusing if working in a team. Equally rebasing should never be used on public branches.

Re-basing can makes the project history cleaner, especially when used with the -i (interactive) flag.

  1. It makes a copy of a repository and downloads it to your machine.

  2. Creating a new repository based on an existing one. E.g. Bitcoin Cash is a fork of Bitcoin.

  3. By going to https://pages.github.com/ and ensuring your project is pushed to your Github account.

1 Like
  1. What is the difference between git and github?
    Git is a local version control system. Github is a web interface for Git that also allows collaboration.

  2. What is the staging area?
    A location to prepare the files that are to be commited.

  3. What does the -m switch do in git commit?
    Allows to add a message describing the change.

  4. What is the difference between merging and rebasing?
    Merging joins two or more branches into one, while keeping the history of the branching. Instead, rebase unifies the branches into a single line, eliminating details of paralell branches.

  5. What does git clone do?
    git clone takes a repository from a github link and creates a local copy.

  6. What is forking?
    Forking is creating an online copy of a github repository so that changes can be made without affecting the original repository.

  7. How can we host a website on GitHub Pages?
    By naming a Github repository ‘username.github.io’. That will be the link to access from a webbrowser.

1 Like
  1. Git enables you to post your code to Github via a terminal, while Github enables you to display your code.
  2. A staging area is an area to display your code.
  3. The -m enables you write a commit message.
  4. Merging in Git puts a forked history “puzzle” back together. Rebasing is putting together several commits to create a new base commit.
  5. Git clone will create a copied version of your code in Github.
  6. Forking is when there changes to your code that does effect the original version.
  7. You can create a repo with your username followed by a github.io link.
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.

  1. What is the staging area?

It is the place you add things to you want to track and may want to commit later.

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

It adds a hopefully descriptive message to your commit.

  1. What is the difference between merging and rebasing?
    Merging preserves history of the branch that is merged into the target branch and rebasing doesn’t.

  2. What does git clone do?
    It makes a local copy of a repository

  3. What is forking?
    Forking makes a copy of a repository on GitHub.

  4. How can we host a website on GitHub Pages?
    Yes through GitHub Pages

1 Like

Git Notes Exercise

  1. Difference between Git and Github is that Git is the version control that lets you manage and keep track of your source code history and Github is a cloud-based hosting service that lets you manage Git repositories.

  2. The staging area is draft space where you can git add the version of a file or multiply files that you want to save in your next commit ie in the next version of your project.

  3. In git commit the m switch lets you include a message of the description of the changes being committed.

  4. The difference between merging and rebasing is that merging adds a new commit, preserving the history and rebase moves a feature branch into a master.

  5. Git clone is a git command that makes a copy of a targeted repository.

  6. Forking is when a copy of an original repository is created that remains on your github account.

  7. You can host website on Github pages as follows:

  • Sign up for /Login to Github Account
  • Create repository with your username
  • Push your code. The html file with name index…
  • Go to setting and click on the settings tab
  • Publish github page
  • Go to website
1 Like

*What is the difference between git and github?

Git is a version control app. GitHub is a web service that allows us to store repositories and host websites.

  • What is the staging area?

It contains changes you want to commit to the git repository. They’re stored and retrievable.

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

Allows us to attach a message to a commit.

  • What is the difference between merging and rebasing?

Merging: when you merge two branches together to create one single branch.

Rebasing: When you move/combine a sequence of commits to a new commit.

  • What does git clone do?

Git clone clones an existing repository and places that copy in a local directory.

  • What is forking?

Allows you to copy an existing repository into your own repository and being able to make changes without affecting the original.

  • How can we host a website on GitHub Pages?

Create a repository with an HTML file and creating a repository named username.github.io

1 Like

After watching the video, answer the following questions:

  • What is the difference between git and github? | While git is a type of terminal you can use, GitHub is a social media platform which allows developers to collaborate and interact in an easy-to-use environment.

  • What is the staging area? | Imagine a box. You can put stuff into the box. You can take stuff out of the box. This box is the staging area of Git.

  • What does the -m switch do in git commit? the-m switch indicates that you will add a commit message.

  • What is the difference between merging and rebasing? | Both are designed to integrate features from another branch into a different one, however, they both do it in very different ways, With merge operating such that the two histories of the branches are tied together, essentially tying the two branches together in a single commit, while rebasing essentially merges two entire branches together from when they split off, rewriting the history from that point, creating a brand new commit.

  • What does git clone do? | A git clone clones an entire repository, storing all the branches, files, ad commits.

  • What is forking? | Forking is essentially cloning an entire repository into one’s computer, allowing you to freely experiment with changes and ideas without affecting the main repository.

  • How can we host a website on GitHub Pages? GitHub Pages allows you to host a static website on their servers for free, by creating a repository like so: yourgithubusernamehere.github.io

1 Like
  1. What is the difference between git and github?

Git is a version control tool, while Github is a social platform and web service for hosting git repositories and facilitating effective collaboration among knowledge workers.

  1. What is the staging area?

An area where the developer chooses which files participate in the next commit. The “opt-in” rather than “opt-out” feature is conducive to the avoidance of the accidental committing of files.

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

Allows for the attachment of a message to the commit, such as a description of the changes.

  1. What is the difference between merging and rebasing?

Merging describes the creation of a third commit stemming from two previous, separate branches (the commits’ parents), while rebasing adds a commit at the end of the master branch, displaying history in a linear fashion.

  1. What does git clone do?

It creates a local copy of a repo.

  1. What is forking?

Forking starts a project based on the copy of an existing code base. Unlike with git cloning, this project is separate from the original and any changes pushed do not affect it.

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

By pushing the website files to a new repo, which should follow the naming convention of username.github.io

1 Like

1. What is the difference between git and GitHub?
Git is a centralized source control management system that allows you to track changes in a repository.
Github is a web interface for git where we store our repositories and also provides an option to host websites.

2. What is the staging area?
It’s a standby area that allows you to look over the changes before committing them.

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

4. What is the difference between merging and rebasing?
Merging is a safe option for preserving the entire history of a repository.
While rebasing is another option for resolving conflicts by creating a linear history by moving the feature branch onto the tip of the master.

5. What does git clone do?
A copy of the central repository can be created using the cloning process. Enabling push operation to push changes to the origin.

6. What is forking?
Another way of creating a copy of the repository. Changes made to the forked repository can be merged with the original via pull request.

7. How can we host a website on GitHub Pages?
By creating a repository with the following name: username.github.io

1 Like
  1. The difference between Git and Github. Git is a local repository system let allows you to track changes in real time. Github is an online open source repository that allows you to share your work with other for review, changes, and collaboration.

  2. The staging area allows you to view changes made before making a commit.

  3. The -m switch commits the changes to git

  4. Merging saves commits to the repository by combining branches and tracks full history.
    Rebasing creates a linear record of changes and moves feature branch to master.

  5. Git clone allows you to clone a copy of another’s repository, some licensing allows you to make changes to those repositories and use as your own as in the Resume built at the end of the lesson. git push -u origin allows git commits to be added to the cloned repository.

  6. Forking is a way of hosting another’s Github repository in your own Github.

  7. We can host a website on Github pages by visiting the sites Github page, forking their repository, rename to your repository username.github.io, then clone to your local machine. From there you will be able to make changes to fit your needs, commit, then push to your Github repository.

Note: Thank you Zsolt for the in depth tutorial, I now have a working Resume in progress and am one step closer to going FULL TIME CRYPTO!

2 Likes
  1. What is the difference between git and github?
  • Git is a version control system that keeps track of source code history, Github is a cloud based hosting services where you can save your repositories
  1. 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).
  1. What does the -m switch do in git commit?
  • The " switch " command allows you to switch your current HEAD branch.
  1. 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.
  1. 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.
  1. What is forking?
  • Forking is a git clone operation executed on a server copy of a projects repo. … You create a new feature branch in your local repo. Work is done to complete the new feature and git commit is executed to save the changes. You then push the new feature branch to your remote forked repo.
  1. How can we host a website on GitHub Pages?
    1. Step 1: Create your website . If you already have a website , than you can move on to step 2. …
  1. Step 2: Add your site to Git Version Control. …
  2. Step 3: Push your site to Github . …
  3. Step 4: Assign your custom domain to your new GitHub pages website .
1 Like
  1. The differences:
    Git is a control system that allows you to manage and track source code.
    Github is a cloud hosting service that lets you manage git files.
  2. A staging area is where files are stored that are waiting to be committed
  3. -m switch allows you to attach a message to your commit.
  4. The difference between merging and rebasing is, merge adds new commits preserving the history, where as rebasing joins two or more histories together by rewriting them.
  5. git clone copies an existing repository into your local computer giving your a full version of that repository.
  6. Forking allows you to copy a repository and experiment with changes without actually changing the original project.
  7. To host a website on Github you create a repository with your username.github.io and then add it to your html file.
1 Like
  • What is the difference between git and github?

Git is an open source distributed version control system.

GitHub is a for-profit company that offers a cloud-based Git repository hosting service. Essentially, it makes it a lot easier for individuals and teams to use Git for version control and collaboration.

GitHub’s interface is user-friendly enough so even novice coders can take advantage of Git. Without GitHub, using Git generally requires a bit more technical savvy and use of the command line.

Additionally, anyone can sign up and host a public code repository for free, which makes GitHub especially popular with open-source projects.


  • What is the staging area?

The staging area is there to keep track of all the files which are to be committed.

Any file which is not added to the staging area will not be committed. This gives the developer control over which files need to be committed.


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

Allows as to enter a relevant commit message to indicate what code changes were done in that particular commit.


  • What is the difference between merging and rebasing?

Merging is useful for combining changes from one branch into another, and for preserving history.

However, if we have multiple branches, the graph becomes more difficult to read when all the branches are merged.

This is where rebasing serves as a useful alternative for a cleaner graph. Rebasing takes the commits from a branch and places them onto another branch. This changes the tree structure by moving the commits and their changes onto the target branch.

Rebasing:

  1. Creates a cleaner history;
  2. More readable graph;
  3. Tougher to resolve conflicts.

Merging:

  1. Preserves history
  2. Easier to resolve conflicts
  3. Easier to undo if you make a mistake

  • What does git clone do?

git clone is used to clone an existing remote repository into your computer.


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


  • How can we host a website on GitHub Pages?

We can fork an existing free website already hosted on GitHub with MIT licence, for instance, then we go to the settings, change the repository name to our GitHub username and add to the username .github.io and the rest is doing by the GitHub itself.


1 Like