What is Git?
Git is a Distributed Version Control System (DVCS) written in the programming language C. Comparing to a normal Central Version Control System (CVCS), a DVCS does not have any central server which stores the data. Every local copy contains the full history of the source code.
Local and Remote Repository
In a DVCS, everyone has a complete copy of the source code (including the complete history of the source code) and can perform version control operations against this local copy. The use of a dvcs does not require a central code repository.
Git commits file changes to your local repository and you can synchronize your repository with other (remote) repositories. Git allows you to clone repositories, e.g. create an exact copy of a repository including the complete history of the source code. Owners of repositories can synchronize changes via push (transferring changes to a remote repository) or pull (getting changes from a remote repository).
Branching and Merging
Git supports branching, e.g. you can have different versions of your source code. If you want to develop a new feature, you may open a branch in your source code and make the changes in this branch without affecting the main line of your code.
Branches in Git can be local. A branch created in a repository which was cloned from another repository does not need to have a counterpart in the remote repository.
Git allows to merge changes from different branches. For example you may have a branch called master which contains the source code which you use to build your product which is delivered to your customers. You use another branch called feature_123 to finalize a certain feature and then use the Git merge command to bring the changes into your master branch.
There are several good places that can help you learn how to us Git.
- Learning tools by Github – Try Git
- Git documentation – Git Docs
- Decent Git introduction video – Power Your Workflow With Git