git is a program that performs version control. The goal here is to keep track of changes to a file so that if you make changes that you then want to undo you can go back to a previous version. The original thinking here was for writing code, though the tools can be used for any type of file. Now days many programs (like MS Office) have some form of version control. Software that just does version control like git allow the version control to be independent of how you change the files. Programs like git allow multiple people to modify files across multiple machines and are really necessary for large coding projects. If you are devloping code by yourself on one machine it is much less necessary, but still useful to learn about. If you are developing code on a local machine but want to run it on cluster, something like git can be a good way to make sure the code on your machine and the cluster is the same. The git workflow is built on the idea of a repository. A repository are the files you are keeping track of and the changes that have been made to those files. The git workflow is based on the following commands:
git init - this creates a repository in the directory where you run this command. Cloning this repository will create a new directory with this name.
git add <filename> - You need to add every file you want to be in the repository
git commit - Adding and other changes are not finalized until you make a commit. Each commit creates a new version that can be gone back to.
git clone - This makes a new copy of the repository at the place you run this command.
git pull - This copies an updated version of the repository to your already existing copy.
git push - This pushes the clone back to the repository.