Git合并后合并打开VIM

问题描述:

我做了2个文件的合并,现在我试图提交,但它打开VIM与以下数据,现在我完全失去了。 (我对VIM没有经验)Git合并后合并打开VIM

Merge branch 'master' of nodester.com:/node/git/lolcoder/****-****** 

Conflicts: 
     .gitignore 
     server.js 
# 
# 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 

我该从这里做什么?

下面是这种情况:

我在github上一个node.js的项目,现在我试图推动这nodester的混帐回购协议(所以我现在有2个遥控器为我的项目)。但在我推送到节点之前,我需要修复2个与节点上为我生成的文件冲突的文件。我解决了与git merge -y的冲突,现在我想提交然后推送。

这是试图推到nodester当我得到的错误:

Nodester! 
To [email protected]:/node/git/lolcoder/****-**************.git 
! [rejected]  master -> master (non-fast-forward) 
error: failed to push some refs to '[email protected]:/node/git/lolcoder/****-************.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. 
+0

这与node.js或nodster无关,请仅使用适当的标签。在这种情况下GIT。 – thenetimp 2012-02-08 18:36:44

+0

我认为这是git的“坏”特性。它只是减少了自动化。我必须包装git命令以使其再次自动化。“ - message”save“适用于我。 – 2017-07-31 01:27:57

Git是打开VIM,因为你的环境变量EDITOR设置为VIM,和Git认为需要提供的提交信息合并操作,因此它打开一个编辑器让你输入一个。

你可以通过改变你的环境的EDITOR变量来改变你喜欢的东西,或者提供一个--message“这是我的提交信息”参数在git merge -y

+0

我做了'git commit - 'message'' – 2012-02-08 18:42:56

+0

什么是EDITOR变量的默认值,这在我之前没有发生过,我希望返回到默认行为。 – Leito 2012-11-07 18:14:57

+0

默认值因系统而异。我不知道你以前是什么。如果您没有永久更改EDITOR变量(在您的.bashrc或类似文件中),那么您可能只需打开一个新终端并恢复正常。 – mattbornski 2012-11-07 22:13:10

如果您想要执行合并并避免打开任何文本编辑器,则可以将--no-edit添加到合并命令中,以便它不会打开提交消息的编辑器。