Changes between Version 36 and Version 37 of GitForDarcsUsers


Ignore:
Timestamp:
Apr 30, 2011 3:59:55 PM (4 years ago)
Author:
igloo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GitForDarcsUsers

    v36 v37  
    547547
    548548If the patch is not the last commit you can also use {{{git rebase -i}}} as above, but instead of deleting the line, change {{{pick}}} to {{{edit}}}.  Rebase will then stop and let you edit the files.  Then do your edits, {{{git commit --amend}}}, then continue the rebase with {{{git rebase --continue}}}.
     549
     550Here's a walkthrough for amending changes you have already made into the second-to-last patch:
     551{{{
     552# Put the local changes out of the way
     553git stash
     554# We want to swap the order of HEAD~0 and HEAD~1 (the two most recent patches)
     555# We therefore rebase from HEAD~2
     556git rebase --interactive HEAD~2
     557# You'll get 2 lines like
     558# pick 2a37b86 Some commit message
     559# pick 4aaaded Another commit message
     560<Swap their order, save and quit>
     561# Now get our changes back
     562git stash pop
     563# and amend the commit
     564git commit --amend -a
     565}}}
    549566
    550567You can do a lot more things with {{{git rebase -i}}}, like reordering changes or joining or splitting patches.  See the "Interactive Mode" section of {{{git rebase --help}}} for more information.