press "esc" (escape) write ":wq" (write & quit)
This usually happens when we're collaborating on a branch with other people, and we've made changes on our local version of a branch, and someone else (or the other you, if you use git to sync between multiple dev platforms) has made changes to the remote version of a branch in the meantime.
How do I cancel a git merge? Use git-reset or git merge --abort to cancel a merge that had conflicts. Please note that all the changes will be reset, and this operation cannot be reverted, so make sure to commit or git-stash all your changes before you start a merge.
In git 1.7.10, the git developers decided merge commits could be made too easily. As explained in this blog post, forcing the interactive commit message behavior should make those commit messages more detailed and could reduce the overall frequency of unnecessary merges.
You can use the --no-edit
flag to avoid this behavior, but, well, don't. Merge commits, like any commits to history, should be well constructed. Your history should be nothing but useful.
To create a shortcut for future use, either:-
Edit your ~/.gitconfig
with the following:
[core]
mergeoptions = --no-edit
Or execute the following in Terminal
git config --global core.mergeoptions --no-edit
First, take heed of the warnings in Christopher's answer above.
Then, if you still want to disable automatic merge commit message editing, set this environment variable:
GIT_MERGE_AUTOEDIT=no
This environment variable and its "no" setting are documented on the git merge doc page. It is recommended to use it only in scripts that need to merge non-interactively, but of course it can be set as part of your shell environment to make its effects more permanent.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With