Git is a tool that can help you track changes in your files, specially when you share your files with your friends on a Linux server.
Here is a very simple description:
log into your server
go to your folder where you want to track files
create a local git repository
Add your files to the local repo
git add myfile.sh
or add more files at once
git add .
Commit your changes to the repo, give a message -m, so that your friends can understand what you have done
git commit -m "myfile.sh: first commit" myfile.sh
or commit all files in current directory (the character “.” is the directory where your files are.)
git commit -m "My files, snapshot" .
Now, start editing your file:
nano -w myfile.sh
After saving your changes, do:
git commit -m "myfile.sh: I have changed an important part in this file" myfile.sh
git commit -m "My files, here is my explanation of the changes" .
Later on, you can do:
to see the log and the changes done
did you forget to commit some files, or did someone change something?