[I]s the management of changes to documents […] Changes are usually identified by a number or letter code, termed the “revision number”, “revision level”, or simply “revision”. For example, an initial set of files is “revision 1”. When the first change is made, the resulting set is “revision 2”, and so on. Each revision is associated with a timestamp and the person making the change. Revisions can be compared, restored, and with some types of files, merged. – Wiki |
Have you ever:
Made a change to code, realised it was a mistake and wanted to revert back?
Lost code or had a backup that was too old?
Had to maintain multiple versions of a product?
Wanted to see the difference between two (or more) versions of your code?
Wanted to prove that a particular change broke or fixed a piece of code?
Wanted to review the history of some code?
Wanted to submit a change to someone else’s code?
Wanted to share your code, or let other people work on your code?
Wanted to see how much work is being done, and where, when and by whom?
Wanted to experiment with a new feature without interfering with working code?
In these cases, and no doubt others, a version control system should make your life easier.
– Stackoverflow (by si618)
During this class (and perhaps, the entire program) we will be using Git.
Git is used by most developers in the world.
A great reference about the tool can be found here
More on what’s stupid about git here.
There are several ways to include Git in your work-pipeline. A few are:
Through command line
Through one of the available Git GUIs:
More alternatives here.
Start the session by pulling (possible) updates: git pull
Make changes
(optional) Add untracked (possibly new) files: git add [target file]
(optional) Stage tracked files that were modified: git add [target file]
(optional) Revert changes on a file: git checkout [target file]
Move changes to the staging area (optional): git add
Commit:
If nothing pending: git commit -m "Your comments go here."
If modifications not staged: git commit -a -m "Your comments go here."
Upload the commit to the remote repo: git push
.