Part II: Working with multiple repositories
So far, we have been working with only one Git repository. However, Git is a distributed version control system, meaning it's great for working with several repositories. These additional repositories can be stored locally, accessed via a network connection, or over the Internet. They can also be hosted on GitHub, GitLab, BitBucket, or any other Git hosting service.
In the next section, we will pretend that we decided to take some work home. In the day of yore, you could have carried this repository on a flash drive and brought it home. Nowadays, we would likely share the repository via GitHub. The truth is, it doesn't matter how you share your work: Git will work the same way. Most of the information in this section can also be applied to working with multiple repositories, whether they are stored locally or shared over a network.
So, for the sake of simplicity, we will pretend that we are using two independent repositories, while having them locally in separate directories, work
and home
.
In the following lessons, we will simultaneously change both copies of our repositories. I'll highlight the steps where we switched to another repository in blocks like this one.