3

我正在尝试将我正在处理的分支推送到其远程分支。我收到消息:

error: failed to push some refs to 'website.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

我跑过去git pull origin得到消息:

you asked to pull from the remote 'origin', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.

运行时git push origin branch_name出现与上述相同的错误,所以我运行git pull origin master.

我有一种感觉,这不是我想要的,现在想以某种方式逃避/中止最后一个命令。我当前的屏幕显示:

From website.com

* branch            master     -> FETCH_HEAD
Auto-merging config/routes.rb

Merge branch 'master' of website into branch

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
# 
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
~                                                                                                                                                
~                                                                                                                                                
~                                                                                                                                                
~                                                                                                                                                                                                                                                                                                                                                                                                                                     

-- INSERT --

对不起,我对 git 很陌生。谁能向我解释如何逃离当前的屏幕以及它要我做什么?

4

1 回答 1

2

您当前正在将位于“origin”的“master”分支上的任何新内容“合并”到本地版本的“master”分支中。当你这样做时,它会要求你解释你在用一条消息做什么。输入一些内容来说明更改是什么,然后按回车键。

为确保一切正常,请尝试以下操作。“获取”源的最新状态,拉取任何更改以确保您是最新的。提交任何新更改,然后将它们推送到服务器。“-a”提交任何已更改的内容。你可能还需要做git add <some file that has changed>

git fetch    
git pull origin master
git commit -m"my changes" -a
git push origin master
于 2013-01-24T17:44:23.713 回答