Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Using both git and cvs



At 18:33 -0700 09 Jun 2013, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
Unfortunately I've now done two commits to the same file on the master
branch.  I'd rather push those back up to origin/master as a single commit.
I'm sure someone has explained this before, but could one of the more
experienced git users here describe how to do so, again?

The easiest way is to do an interactive rebase. You can start that with:

 git rebase -i HEAD~2

That will spawn an editor showing the summary lines of the two most recent commits from your current branch on lines starting with "pick". Change the "pick" on the second line to either "squash" or "fixup", then save and exit the editor. If you used "squash" you will be asked to write a message for the new, joined commit based on the messages for both of the previous commits, otherwise it will just use the message from the first commit.



Messages sorted by: Reverse Date, Date, Thread, Author