Most British folk grow up knowing the word ‘Git’ as a derogatory and perhaps slightly offensive insult. However, in the world of computer science and programming, it happens to be one of the most useful tools available to make developers lives easier.
Put simply, Git is a ‘version control system’ and when several people are working together on the same document, it helps with managing a change log of small incremental modifications to the files in a directory.
“He added this line of text, she removed that line, and then added this comment .. etc”
Under normal circumstances, when you look at a folder of files on your computer, it’s a snap shot of those files as they are today. However if Git was managing that folder, the files would have their history stored as a time line and you can determine what’s changed at certain points in time. Git is also a time machine for your files and you can travel forwards and backwards reverting to prior states.
If you think of Git history as a train line then a Git “Commit” is a station. At any station you may decide to “Branch” off and create a new line (with a different name) that diverges away from the original. This is akin to “save as” and, for a period of time, we may work on a separate branch to avoid polluting the original “Master” branch. We may experiment or develop new features here whilst the Master branch remains intact. However, with Git, it’s also possible to “Merge” the changes back into the Master branch at a later stage if we decide they should become part of the main line.