User Tools

Site Tools


git_merge

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
git_merge [2019/03/07 13:55]
rpjday [Global merge.ff option]
git_merge [2019/03/13 13:09] (current)
rpjday [Global merge.ff option]
Line 363: Line 363:
  
 This setting is superseded by any per-branch fast-forward merge setting. This setting is superseded by any per-branch fast-forward merge setting.
 +
 +===== Merge strategies =====
 +
 +==== ours ====
 +
 +Technically record a merge while totally ignoring its content -- for record-keeping.
 +
 +Example:
 +
 +<​code>​
 +$ git checkout master
 +$ git merge --strategy=ours <​obsolete branch>
 +</​code>​
 +
 +How to make ''​master''​ look exactly like ''​develop'':​
 +
 +<​code>​
 +$ git checkout topic
 +$ git merge -s ours master
 +$ git checkout master
 +$ git merge --ff-only topic
 +</​code>​
 +
 +To do this for an arbitrary commit, create a temporary branch:
 +
 +<​code>​
 +$ git checkout -b tempbranch <commit ID>
 +$ git merge -s ours master
 +$ git checkout master
 +$ git merge --ff-only tempbranch
 +</​code>​
git_merge.txt ยท Last modified: 2019/03/13 13:09 by rpjday