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] – [Global merge.ff option] rpjdaygit_merge [2019/03/13 13:09] (current) – [Global merge.ff option] rpjday
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.1551966945.txt.gz
  • Last modified: 2019/03/07 13:55
  • by rpjday