如何在 git 中找到问题原因



我有 Git 问题(不是 huuummmmpf):
我无法推送到特定分支
然后我重新拉一个重新推,甚至一个拉-变基和重新推.

没有发生任何新情况。
(我已经想出了一种发送我的作品的方法)

您有任何搜索字段要建议吗?

我真的希望将来能够自己解决这些问题。
实际上,作为学生没有所有的答案是可以理解的。但是我对这个案子有点迷茫和无源(这让我很不舒服)。
我在哪里可以找到线索来弄清楚这个该死的回购发生了什么。

PS:我通过你们的努力节省了很多项目,非常感谢你们所有人。

$ git pull origin stef
From github.com:PierreND/approfusion
 * branch            stef       -> FETCH_HEAD
Already up-to-date.
$ git pull --rebase origin stef
From github.com:PierreND/approfusion
 * branch            stef       -> FETCH_HEAD
Current branch 25_push is up to date.
$ git push origin stef
To git@github.com:PierreND/approfusion.git
 ! [rejected]        stef -> stef (non-fast-forward)
error: failed to push some refs to 'git@github.com:PierreND/approfusion.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and merge the remote changes
hint: (e.g. 'git pull') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

git pull --rebase 给你线索:

Current branch 25_push is up to date.

这意味着git branch应该将分支25_push显示为当前分支。

切换到stef分支:

git checkout stef
git pull --rebase
git push

我建议将推送策略设置为"简单",以便将推送限制为当前分支(而不是所有本地分支)

git config --global push.default simple

最新更新