Git is a Version Control System tool. In simple terms, Google Docs for coders. This tool makes it very easy for many different users or developers to write, edit or make commits to the server repository like GitHub or BitBucket.
There are many tools available to use Git. There are 3 ways to use Git:
- Git CMD
Using git functions on regular Window cmd. Everthing will be through command line.
- Git Bash
Using git functions in bash environment on Windows. For Linux users who also want to use the standard unix commands.
- Git GUI (Graphical User Inteface)
Using git functions without touching command line with nicer inteface. Some GUIs recommended will be Sourcetree or GitHub Desktop.
Repository is location where software packages can be stored so that they can be installed on a computer. Some repositories are GitHub, BitBucket and GitLab. GitHub is recommended since it is the largest repository host and it is free!
When making a repository in GitHub, you can click here to refer to a GitHub guide.
Branches are basically like different versions of a file. At first, there is a master branch. Use branches to experiment first before committing them to master branch.
When you branch from a branch, it means you are making the copy of the branch at that point in time.
Commit - Commits are changes that you want to record in a repository. Think of it as you are saving your changes to your laptop. This only happens locally so the rest of the people who may be working on the same repo wont see it.
Push - After commits you can push which is uploading your "saved" copy from the commits you have made to online repo so that other people can also see the changes you have made. Pull may need to be done first before push if there are other people working on the same repo.
Pull - Merge your local repo with any changes that has been done to the repo by other people.
Fetch - Fetch is similar to pull except that it does not merge for you. This means that you can see what other people have pushed but it will not change your own.