Git is a revision control software. If you make many revisions to a file or set of files, then you need it. It can help you extract previous/latest versions of the file(s) you are working on. Git can be used in 2 different ways:
- Single editor mode: You are the sole owner and editor of a file or a set of files.
- Multiple editor mode: There are many editors who are improving a common file or set of files.
Single Editor Mode
- With(out) the command prompt, move all files & directories a directory which for the sake of this example we will call “repository”. Go to the folder through command prompt.
- Type “git init”
- Type “git add .”
- Type “git commit” and enter a message in the editor and save the file.
- When you start working, you go to the “repository” directory and type “git checkout” to get the latest version of all your files into that directory.
- You make changes to those files and add new files as necessary.
- Type “git commit -a” and enter a message in the editor and save the file.
Multiple editor mode
When there are many editors who work on a set files as a team, there 2 ways your team can be organized:
- Blackboard mode: A common repository of file(s) which any team member can edit and add new files to. There might be gate keepers who will first verify the sanity of the changes you submit to the repository.
- Circle of Trust mode: There will be a leader for your team. This leader will have a circle of trust, that is, a group of people who are allowed to make changes to his set of files. If you are not in the leader’s circle of trust, as a team member you will be in the circle of trust of one of his subordinates or sub- subordinates etc. Each circle of trust will have a common repository to which you submit your changes.
(To be continued…)