git patch update code patch

Scenes:

From the master branch pull branch br1, pull from branches br2 branch br1, later found br1 development features required to abolish, br2 branch applies only to properties.

solution:

A. Not much br2 branch commit, unique submit it directly into the master branch git cherry-pick br2.

Two. Br2 branch to submit more, git cherry-pick operation costs slightly

       1. The processing manner applied git diff

                (1). git diff br2 br1 > patch

                (2), git checkout br1

                (3). git apply patch

                (4) confirmed the indefinite content can be submitted to the current branch

            If the first (3) step fails, do the patch -p1 <patch, you will be prompted to modify the file has been backed up can be deleted. Confirm file updates

 

       2. Use the git format-patch mode

                 (. 1). Git the format BR1 -M-patch 
                 (2). Indefinite order in accordance with the generated sequentially using the patch application content git am

             In this manner somewhat similar to direct manipulation git cherry-pick, and continuing the search directly a follow-up manner patch.

 

 

 

 

Published 20 original articles · won praise 0 · views 10000 +

Guess you like

Origin blog.csdn.net/u011248560/article/details/100922800