tags:

views:

62

answers:

2

Just say you have a development branch with 100 mostly pointless commit/log messages. Is it possible to merge the dev branch to the master/head and have only one log message in the master branch? ie one log message on the head/master branch might say "Adds features XYZ"

It seems there are two correct answers. Using squash allows you to hide all of the commits from the master branch, and using interactive rebase allows you to hide selected parts of the history from the master branch.

+7  A: 

git-merge --squash should do this.

(More documentation on git-merge)

Phil
I think this is the answer to my question, even if using the rebase option is probably a better thing to do.
corydoras
+6  A: 

It sounds like git rebase --interactive is what you need. This section of the Git Book explains:

You can also rebase interactively. This is often used to re-write your own commit objects before pushing them somewhere. It is an easy way to split, merge or re-order commits before sharing them with others. You can also use it to clean up commits you've pulled from someone when applying them locally.

Tim Henigan
'git rebase -i' is one of the greatest things I've ever learned.
Carl Norum
Thanks! I will make a point to learn this
corydoras
Agreed. You don't want to squash (destroying history) if you can instead rewrite history to make it concise but still useful. Plus interactive rebases make you feel oh so powerful.
Jefromi