There are 3 ways listed below to do this and you don’t have to replicate :wq
to do so.
1 - Using --no-edit
using the --no-edit
option, the auto-generated message will be accepted (this is generally discouraged, see the git docs)
So after you git pull origin <remote_branch>
, you can use
git merge master --no-edit
2 - Using environement variable
Older scripts may depend on the historical behaviour of not allowing the user to edit the merge log message. They will see an editor opened when they run git merge. To make it easier to adjust such scripts to the updated behaviour, the environment variable GIT_MERGE_AUTOEDIT
can be set to no
at the beginning of them. — git docs
Use
GIT_MERGE_AUTOEDIT=no
before the merge line
3 - Use -m
to provide the message
Set the commit message to be used for the merge commit (in case one is created).
If --log is specified, a shortlog of the commits being merged will be appended to the specified message.
The git fmt-merge-msg
command can be used to give a good default for automated git merge invocations. The automated message can include the branch description. — git docs
git merge master -m "Merge master"
Read more: the git merge
command