我合并了两个文件,现在尝试进行提交,但它打开了VIM并显示以下数据,我完全不知所措。(我没有使用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的git仓库(所以我的项目现在有两个远程仓库)。但在推送到nodester之前,我需要修复与nodester为我生成的文件冲突的2个文件。我用git merge -y
解决了这些冲突,现在我想要提交并推送。
这是当我尝试推送到nodester时收到的错误信息:
Nodester!
To git@nodester.com:/node/git/lolcoder/****-**************.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@nodester.com:/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.
--message "save"
对我有用。 - bronze man