Chapter 13. Pushing your changes

 

You’re now halfway through your study of how to collaborate with Git. You’ve learned how to clone repositories (git clone) and how to work with remotes (git remote). In the preceding chapter, you created the environment shown in figure 13.1 on your local computer. Cloning and making remotes establishes the groundwork for the next two commands: git push and git pull.

Figure 13.1. Carol can push files.

In this chapter, you’ll learn about the git push command, the first half of the Git collaboration process (git pull is the second half, covered in the next chapter). git push is important because it’s how you share (publish) your changes. You’ll see that git push merges those changes with the repository you’re pushing to. This may cause conflicts, and you’ll see how to recover from those. git push operates on your changes in branches, and you’ll see how it does double-duty creating and deleting branches and tags on remotes.

13.1. Pushing sends changes to a remote

Everything that you’ve done up to now has affected only your local repository. In chapter 12, you learned about the git ls-remote command, which enables you to list the contents of a remote repository. The git push command is the first command that will directly affect another repository besides your own.

13.1.1. Permissions are required

13.2. Understanding push conflicts

13.3. Pushing branches

13.4. Deleting branches on the remote

13.5. Pushing and deleting tags

13.6. Configuring simple pushes

13.7. Lab

13.8. Further exploration

13.9. Commands in this chapter

sitemap