How to disable the merge message in git pull?

3

Whenever I hit git pull , git opens the text editor asking for a merge commit message. However this message is already preloaded (as in the example below), and I simply save and close the window to finish the procedure.

Merge branch 'dev' of https://bitbucket.org/myproject into dev

In the case of my team, it does not make sense to customize this message. How do I disable this request?

    
asked by anonymous 07.04.2017 / 14:22

3 answers

3

The command you want is

$ git pull --no-edit

I personally prefer to use --no-edit when I do git merge and not git pull because for me it's important to know when HEAD of my local repository does not match the remote.

    
10.04.2017 / 00:17
2

This message only happens when you make a git pull and the remote repository has received new commits .

Since git needs to reconcile the commits with your local commit , by default it will 3-way merge and create this new commit commit, this message in case you want to modify it.

One way to avoid this is to use git pull --rebase , so it will recreate local commits from a new parent (in this case the remote HEAD) and you will not have this problem with commit .

For more details see some references:

10.04.2017 / 02:42
0

Are you interested in committing immediately? if this is your goal depending on the manager you use in the case of gitkraken or sourcetree you have the possibility to mark merge immediately after the merge (if there is no conflict) there is no need to write or do anything just send to origin, only give the push. The message is only in case of interest in customizing I believe.

    
07.04.2017 / 14:43