Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| git_merge [2019/03/07 13:55] – [Global merge.ff option] rpjday | git_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: | ||
| + | |||
| + | < | ||
| + | $ git checkout master | ||
| + | $ git merge --strategy=ours < | ||
| + | </ | ||
| + | |||
| + | How to make '' | ||
| + | |||
| + | < | ||
| + | $ git checkout topic | ||
| + | $ git merge -s ours master | ||
| + | $ git checkout master | ||
| + | $ git merge --ff-only topic | ||
| + | </ | ||
| + | |||
| + | To do this for an arbitrary commit, create a temporary branch: | ||
| + | |||
| + | < | ||
| + | $ git checkout -b tempbranch <commit ID> | ||
| + | $ git merge -s ours master | ||
| + | $ git checkout master | ||
| + | $ git merge --ff-only tempbranch | ||
| + | </ | ||