Blog
Git Merge Merging and ReReRe
Posted on September 2, 2020 in Git by Matt Jennings
Merge Commits
- Commits that have more than one parent
Merge Commit Example Code
git cat-file -p c539b61
tree 3740b67563058ba5a8ca39db2fa782e94ad24f1b
parent 5a07a807828c0321472b61bf45fc228bef134d4b
parent 7f5eff26f7cb97e10d201189cc77bb25fc4bd1d1
author Matt Jennings <050906352e09201c1c1824000a28060f016f000135> 1598825747 -0700
committer Matt Jennings <050906352e09201c1c1824000a28060f016f000135> 1598825747 -0700
Merge branch 'exercise2'
Git Merge –no-ff (No Fast Forward)
- To retain the history a merge commit, even if there are no changes to the base branch:
git merge --no-ff
Merge Conflicts
- Attempt to merge, but file have diverged too much.
Git ReReRe – Reuse Recorded Resolution
- git save how you resolved a conflict
- New conflict: reuse the same resolution
- Useful for:
- Long lived feature branchÂ
- Rebasing
Git ReReRe – Reuse Recorded Resolution
- Turn on only in a single repo:
git config rerere.enabled true
Git Show Log
- Show log of commits without branch graph:
git --no-pager log --oneline
- Show log of commits with branch graph:
git --no-pager log --graph
Leave a Reply