混帐错误:未能推送一些裁判 [英] git error: failed to push some refs to
问题描述
也许我搞砸了配置或什么。
这是发生了什么:
当我使用git push origin master
p>
我的工作目录和远程资源库看起来像这样:
如果GitHub仓库看到新的提交到它,当你在本地工作,我会建议使用:
git pull --rebase
git推
完整的语法是:
git pull --rebase origin master
git push origin master
查看第6章使用 我会推荐一个: 这会在您的本地主分支和它的上游分支。 请参阅为什么我需要显式推送新分支?。 由于OP已经在 不需要 注意: For some reason, I can't push now, whereas I could do it yesterday.
Maybe I messed up with configs or something. This is what happens: When I use the git push origin master What my working directory and remote repository looks like: If the GitHub repo has seen new commits pushed to it, while you were working locally, I would advise using: The full syntax is: That way, you would replay (the See a more complete example in the chapter 6 Pull with rebase of the Git Pocket Book. I would recommend a: That would establish a tracking relationship between your local master branch and its upstream branch. See "Why do I need to explicitly push a new branch?". Since the OP already reset and redone its commit on top of There is no need to Note: 这篇关于混帐错误:未能推送一些裁判的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
通过这种方式,您可以在新更新的 origin / master $之上重播(
- rebase
部分)本地提交c $ c>(或 origin / yourBranch
: git pull origin yourBr $ b
git push -u origin master
之后,任何未来推送该分支都可以用一个简单的方法来完成:
git push
origin / master $ c之上重置并重新提交它的提交
$ c>:
g它重置 - 混合起源/主
git add。
git commit -m这是我原本计划修改的新提交
git push origin master
拉--rebase
。
git reset --mixed origin / master
也可以写成 git reset origin / master
,因为 - 混合
选项是使用 git reset
。git pull --rebase
git push
git pull --rebase origin master
git push origin master
--rebase
part) your local commits on top of the newly updated origin/master
(or origin/yourBranch
: git pull origin yourBranch
).git push -u origin master
After that, any future push for that branch can be done with a simple:git push
origin/master
:git reset --mixed origin/master
git add .
git commit -m "This is a new commit for what I originally planned to be amended"
git push origin master
pull --rebase
.git reset --mixed origin/master
can also be written git reset origin/master
, since the --mixed
option is the default one when using git reset
.