Chapter 2. Remote Git
This chapter covers
- Downloading a remote repository
- Sending changes to and receiving changes from a remote repository
- Creating and receiving branches
- Merging commits from one branch to another
As you learned in technique 1, it’s possible to work entirely with Git as a local version control system and never share changes with others. Usually, however, if you’re using a version control system, you’ll want to share changes: from simply sending files to a remote server for backup to collaborating as part of a large development team. Team collaboration also requires knowledge of how to create and interact with branches for working on different features in parallel. Let’s start by adding a remote repository.
Typically when using version control, you’ll want to share your commits with other people using other computers. With a traditional centralized version control system (such as Subversion or CVS), the repository is usually stored on another machine. As you make a commit, it’s sent over the network, checked to see whether it can apply (there may be other changes since you last checked), and then committed to the version control system where others can see it.