Level 3 Linux Exercises
Linux Exercise #3.7 – Revision Control
Background Information
There are many tools available to assist with revision control. The idea of revision control is to allow you to make modifications to files and roll those back if they are not correct. It is also useful to track changes that have been made. And, probably most important is that it provides an automatic back-up system and ability for groups to work together easily checking-in and out files for use.
To assist with future classes that you may be taking, we will help with this lab by setting up a Git repository on the Computer Science department’s server and begin using it to backup and version control your code. Git is a form of version control and as such it is an incredibly useful tool for backing up work, working across multiple computers, or working in teams. Although there are public sites such as github, it is a violation to post any code or assignments on a public site without instructor permission.
For version control, Git provides a code repository that we will use to save our software. This is separate from saving a file. When we do so, we add a record to our repository specifying exactly what changes we have made and on which lines. The key here is that we are creating a record of changes, not replacing files. What this means is that our repository will only know about the changes that we tell it about!
The benefit of this is that we will have a complete record of the path you took to develop your software. And, you can reconstruct it at any point along the timeline. We can go back to any previous point (revert changes), or we can even split (or fork) the timeline so that we can work on two features simultaneously without worrying about a change in one breaking the other. In general, it is always a good idea to commit early and commit often.
Git uses a distributed version control system model, rather than a single central repository. This means that we can work with multiple full repositories and we can upload (push) or download (pull) between them at will. In this course, we will talk about one repository, but we will take advantage of some of the distributed features in recitation.
Using Git to Backup Files