Condense Git Branch

Assume we are in branch BR and branched from DEVELOP.

Show the commits in branch BR (which we are in) since branching from DEVELOP. Verify that it looks ok.

[BR *] $ git log develop..

Condense your changes down to a single commit.

An editor will pop up and you should keep the work "pick" in front of the top commit (and others if you want to keep others too). If front of all the other lines, remove the word "pick" and put in the letter "s" (for squash). Any commit starting with the letter "s" will disappear.

Save the file and exit.

Another editor will appear where you can modify the commit message. It will default to all the commit messages from the squashed commits.

[BR *] $ git rebase -i develop


CategoryComputing.SCM.Git