Differences

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

Link to this comparison view

Both sides previous revision Previous revision
software:git [2016/01/28 22:02]
cyril [Editing commits]
software:git [2024/11/06 22:20] (current)
cyril [Editing commits]
Line 180: Line 180:
 <code> <code>
 git rebase -i <latest-commit-to-keep-unchanged> git rebase -i <latest-commit-to-keep-unchanged>
-# set "reword" if you want to change message +# set "r(reword) if you want to change message 
-# set "edit" if you want to amend the commit (git commit --amend; git rebase --continue) +# set "e(edit) if you want to amend the commit (git commit --amend; git rebase --continue) 
-# set "squash" if you want to merge with the previous commit+# set "s" (squash) if you want to merge with the previous commit and merging or editing the commit message 
 +# set "f" (fixup) if you want to merge with the previous commit without interaction
 # you can even reorder the commits! # you can even reorder the commits!
 </code> </code>
 +Tips with ''rebase -i'':
 +  * If you have a bunch of fixup commits, first move them one by one (i.e. move one, apply, rebase again, move another one, apply, etc), so that if you prefer to abort due to conflicts you don't lose the ones before, and then really mark them "f" (nothing can go wrong afterwards)
 +  * If you are just moving and merging some fixup commits, you may want to check that the end result is identical, by making a copy and then performing a diff.
 +  * If you move a fixup commit up and keep getting conflicts after its initial position, it means that you made a mistake in the conflict resolution
  
 Change author or date: use ''rebase -i'', chose "edit", and commit with: Change author or date: use ''rebase -i'', chose "edit", and commit with:
software/git.txt · Last modified: 2024/11/06 22:20 by cyril
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0