奇怪的git推送错误
遇到了第二个git push
错误,我只是想在同一个Pull Request中添加一些新的改变,想怎么解决这个问题?谢谢。奇怪的git推送错误
GIT中操作
git checkout -b newFooBranch
git add <name of file changed>
git commit -m 'add some initial changes'
git push origin newFooBranch
// make some changes
git add <name of same file changed>
git commit -m 'add some new changes on the same file'
// met with error when executing below command
git push origin newFooBranch
错误消息,
To [email protected]:foo/goo.git
! [rejected] newFooBranch -> newFooBranch (non-fast-forward)
error: failed to push some refs to '[email protected]:foo/goo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
编辑1,
git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.
git pull <remote> <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=origin/<branch> newFooBranch
问候,推你的变化之前
git remote update
git rebase origin/newFooBranch
: 林
执行下列任:
git pull
或。
感谢Nishant,当我执行'git pull'时,投了票,遇到了错误,如果您有任何想法,请在我的原始帖子的编辑1部分发帖,这将非常棒。 –
尝试'git pull origin newFooBranch'。 –
你也可以按照错误消息所说的做'git branch --set-upstream-to = origin/newFooBranch newFooBranch'。基本上git不知道从哪个分支拉出(因为新分支没有任何上游创建),所以它要求你更具体。 –
如果没有其他人已经提交到该分支并推送,那么您已经移动了本地HEAD指针,可能使用'git checkout'命令。看看github,看看哪些提交与本地提交不同。 –
@AndyRay,谢谢你,投票了。你是什么意思“只要看看github,看看哪些提交与你的本地提交不同”?有没有关于github.com的部分可以看到? –