Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

merge branches without commit messages

Tags:

git

merge

Assuming following "workflow"

create branch master
add + commit some files
create and checkout branch dev
edit and commit several times with silly commit messages
checkout master
merge dev branch into master branch

in the last step is it possible to not introduce all the (silly) commit messages from the commits on the dev branch and just have one single commit message like e.g. "merged dev branch today"?

matthias

like image 436
Matthias Avatar asked Feb 15 '13 11:02

Matthias


1 Answers

You want commit-squashing, which can be done in several ways:

  • If you want fine-grained control over which commits are contained in the squash, if you want to squash your feature commits into more than one commit (e.g. to split up logical changes), or if you only want to change the commit messages, "rebasing interactively" (git rebase -i) is for you.
  • If you want to do it quick and merge all of the concerned commits into one, you can use the --squash option to git merge, git rebase and git pull

More about both topics can be found in Chapter 6 of the Pro Git book and in the man pages of the commands, linked above.

like image 114
Nevik Rehnel Avatar answered Sep 22 '22 10:09

Nevik Rehnel