Git Commit after merge opens VIM

I did a merge of 2 files and now Im trying to commit but it opens VIM with the following data and now I’m completely lost. (I have no experience with VIM)

Merge branch 'master' of****-******

# It looks like you may be committing a merge.
# If this is not correct, please remove the file
#       .git/MERGE_HEAD
# and try again.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#       .project
".git/COMMIT_EDITMSG" 19L, 521C                               1,1           All

What do I do from here?

  • git diff with combined --word-diff
  • How can I re-configure Diff & Merge Tools to its default settings (clickable links) in Git Settings window in Visual Studio?
  • Using Maven Archetype Generate in the same Directory
  • How to fix “address space is already occupied” error on fetch/commit?
  • Connect to TFS Git from Xamarin Studio (non-hosted, locally installed TFS 2013)
  • How to use docker for deployment and development?
  • Here is the scenario:

    I had a node.js project on github, now I’m trying to push this to nodester’s git repo (so I now have 2 remotes for my project). But before I can push to nodester, I needed to fix 2 files that conflicted with the ones generated on nodester for me. I solved the conflicts with git merge -y and now I want to commit then push.

    This is the error I get when trying to push to nodester:

     ! [rejected]        master -> master (non-fast-forward)
    error: failed to push some refs to '****-************.git'
    To prevent you from losing history, non-fast-forward updates were rejected
    Merge the remote changes (e.g. 'git pull') before pushing again.  See the
    'Note about fast-forwards' section of 'git push --help' for details.

  • Best way to avoid merging a branch into another one
  • Ignoring symlinks in git
  • Git: How to move contents of gh-pages branch to docs/ directory preserving history?
  • How to stop git add -patch not displaying prompt in mintty
  • How to listen to webhooks from bash script?
  • Should I use .gitignore, or auto-detect configurations for different servers in staging?
  • 2 Solutions collect form web for “Git Commit after merge opens VIM”

    Git is opening vim because your environment variable EDITOR is set to vim, and Git believes you need to provide a commit message for the merge operation, therefore it is opening an editor for you to type one in.

    You can fix this by changing your environment’s EDITOR variable to something you prefer, or by providing a –message “this is my commit message” argument after git merge -y

    If what you want is to perform the merge and avoid opening any text editor, you can add --no-edit to your merge command so that it won’t open the editor for the commit message.

    Git Baby is a git and github fan, let's start git clone.