Chapter 8. Cloning and Fetching

[ 8 ]

Cloning and Fetching

In the last chapter, you learned about remote repositories and you created one for the Rainbow project.

In this chapter, you are going to start simulating what it would be like to work with a friend on the Rainbow project. To do that, you are going to learn about cloning remote repositories and how this differs from initializing repositories locally. You will also learn more about defining upstream branches, deleting branches, and fetching data from a remote repository.

[ Note ]

Some text editors that have Git integrations allow you to define certain settings for Git. This chapter assumes that you have not enabled any special settings that will cause Git to deviate from its default behavior.

For example, Visual Studio Code has a feature called Autofetch (git.autofetch) that will periodically fetch changes from a remote repository. (You will learn about fetching later in this chapter.) This feature is disabled by default, and for you to be able to do the exercises in this chapter properly it should remain disabled. If you have enabled it in the past, then please disable it before continuing.

If you have never configured any special Git settings for your text editor, you don’t need to worry about this.

State of the Local and Remote Repositories

At the start of this chapter, you should have a local repository called rainbow and a remote repository called rainbow-remote. These two repositories ...

Get Learning Git now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.