4 phillip stanley-marbell
version control repository available to others. One popular example of such
a service is GitHub.
A.1.1 Git and GitHub are separate things
The program
git runs on your PC and allows you to keep track of versions
or revisions of your files by storing histories of the changes you make to files.
GitHub, on the other hand, is a website that hosts Git repositories. You can
create an account and use it to host copies of your repository to allow you to
collaborate with others.
A.1.2 GitHub online operation: fork
If you will eventually want to compare or contribute changes you have made
to someone else’s repository, it is necessary to have a way to make a copy of
their repository in such a way that you can compare your history of changes
to theirs in a robust way. GitHub provides a method to do this and it is called
forking a repository. Forking a repository is something you do on the GitHub
site and it is not an operation in the
git command line. Find out more about
forking a repository on GitHub online.
A.1.3 Git command line operation:
git clone
Forking a repository online adds a copy of the repository to your GitHub
online account and keeps track of the original repository you forked. To get
the copy you have made online onto your local workstation, you will need to
use the Git command line and the
git clone operation.
A.1.4 Git command line operation:
git commit
Once you have your local clone of the forked repository, you can start making
changes and recording snapshots of your changes using git commit. Impor-
tant: Aim to have at least one
git commit in the forked repository each day to
keep a snapshot of your progress and git push to the corresponding GitHub
account to back up your change history on GitHub. If you fail to do so, you
run the risk of losing all your work when things go wrong. You can have
as many commits as you wish and the more you have the easier it will be to
track down what went wrong when parts of your project stop working. Find
out more about
git commit and git push by browsing the git tutorial online.
We discuss
git push a bit more, below.