Summary

This chapter has shown how to effectively use branches for development and for collaboration.

We got to know a wide set of the various uses of branches, from integration, through release management and the parallel development of features, to fixing bugs. You have learned different branching workflows, including the very useful and widely used topic branch workflow. The knowledge should help you make the best use of branching, customizing the model of work to fit the project and your own preferences.

You have also learned how to deal with multiple branches per repository while downloading or publishing changes. Git provides flexibility in how the information on branches and other refs in the remote repository are managed using the so-called refspecs to define mapping to local refs: remote-tracking branches, local branches, and tags. Usually, fetching is governed by fetch refspec, but pushing is managed by the configured push mode. Various collaborative workflows require a different handling of branch publishing; this chapter describes which push mode to use with which workflow and explains why.

You also got to know a few useful tricks. One of them is how to store the project's web page or the generated HTML documentation in a single repository with the "orphan" branch trick (which is used, for example, by GitHub Project Pages). You found out how to synchronize the working directory of the remote repository (for example, for the deployment of a web application) with git push; one of the possible solutions. You have learned how to do fetch equivalent with push, if the connection is possible only in the opposite direction.

The next chapter, Chapter 7, Merging Changes Together, will explain how to integrate changes from other branches and other developers. You will learn about merging and rebasing, and how to deal with situations where Git could not do it automatically (how to handle various types of merge conflicts). You will also learn about cherry-picking and reverting commits.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset