【发布时间】:2014-11-28 07:35:44
【问题描述】:
我已经检查了特定的提交:
git checkout xx
#made changes
...
git add .
git commit -m "abcd"
git push
但我在 github 网站上没有看到任何更新。
请帮助我成功推送到我的分叉仓库。
【问题讨论】:
我已经检查了特定的提交:
git checkout xx
#made changes
...
git add .
git commit -m "abcd"
git push
但我在 github 网站上没有看到任何更新。
请帮助我成功推送到我的分叉仓库。
【问题讨论】:
您已签出提交而不是分支:您处于分离的 HEAD 模式,git push 拒绝推送分离的头。
见“Why did my Git repo enter a detached HEAD state?”
您需要根据当前提交创建一个新分支,或者在该提交上重置一个现有分支。
见“git: switch branch without detaching head”。
一旦您的提交被分支引用(如git branch 命令所示),您将能够将该分支推送到您的远程仓库。
注意:使用 Git 2.23(2019 年 8 月),您可以使用 git restore 和 update your working tree 分离 HEAD(因为您不切换分支)。
要切换分支,您现在拥有(同样是 Git 2.23)git switch。
【讨论】: