Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accept default git commit message after a squashed merge

I would like to do the following in a script:

git merge --squash someBranch
git push

The problem is that the merge does not do a commit. So before the push I have to commit. The default commit message created by this merge is sufficient. So my questions are:

  1. Can I do the merge with automatically generating the commit?

  2. Or can I add a command in the script to do a commit which accepts the default message?

Thanks!

like image 245
Lars Bilke Avatar asked Sep 02 '25 09:09

Lars Bilke


1 Answers

The default commit message after a merge is in .git/MERGE_MSG, so you could do the following:

 git commit -F .git/MERGE_MSG

... after the merge.

like image 147
Mark Longair Avatar answered Sep 04 '25 04:09

Mark Longair