Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automate git merge to not prompt to confirm the commit message?

Tags:

git

automation

I'm trying to do some automation scripts using git, simple things like updating submodules, moving to proper tags etc, but one of the problems I'm now finding is that git now forces you to confirm a merge message. Is there any way to squelch this behavior from happening?

like image 920
buzzedword Avatar asked Jul 03 '12 21:07

buzzedword


People also ask

How do I stop git from merging messages?

press "esc" (escape) write ":wq" (write & quit)

How do I merge without committing?

OPTIONS. Perform the merge and commit the result. This option can be used to override --no-commit. 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.

How do I change the commit message in merge request?

If the commit only exists in your local repository and has not been pushed to GitHub.com, you can amend the commit message with the git commit --amend command. On the command line, navigate to the repository that contains the commit you want to amend. Type git commit --amend and press Enter.


2 Answers

You can add the --no-edit switch to git-merge and it will not ask you to confirm the merge message.

like image 128
ziad-saab Avatar answered Oct 13 '22 01:10

ziad-saab


To prevent git from promting you for an commit message on mac add this to your .bashrc or .bash_profile (read more about the difference between the two files)

export GIT_MERGE_AUTOEDIT=no 

Then in your terminal type:

source ~/.bashrc 

to reload your bash-file and continue without any interference.

like image 24
ola Avatar answered Oct 13 '22 01:10

ola