33 Git Version Control


Git is the most widely used version control system today. Microsoft’s centralised github platform hosts many and perhaps most of today’s open source projects as well as supporting many product teams. As a popular and freedom caring alternative gitlab can either host your git repository for you or else you can install your own gitlab server. Another major commercial git provider is bitbucket.

The basic starting point for using git is to clone a pre-existing repository or one that you have forked. You can also create your own repository through the various git portals using your web browser. Once you have a git repository that you wish to work on you can clone the repository to create your own working copy:

git clone git@github.com:kt/audit.git

The same is achieved with:

gh repo clone kt/audit

Either will create a copy of the repository on your local storage. By default this will also be known as the main branch. The main branch is duplicated locally as the working copy and remotely as the origin (shorthand for the original repository’s URI).

You are now ready to make changes to the local repository. We will generally assume it is a repository that you have created, forked into your own account, or else have been granted access to as a developer. That is, you have commit access to the repository.

Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0