Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

merging dev branch to head with only one log message

Tags:

git

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.

like image 615
corydoras Avatar asked Oct 06 '09 00:10

corydoras


People also ask

How do I merge without committing?

With --no-commit perform the merge and stop just before creating a merge commit, to give the user a chance to inspect and further tweak the merge result before committing. Note that fast-forward updates do not create a merge commit and therefore there is no way to stop those merges with --no-commit.


1 Answers

git-merge --squash followed by git commit should do this.

(More documentation on git-merge)

like image 101
Phil Avatar answered Sep 23 '22 20:09

Phil