我关注的 GitHub 上有一个项目(上游):
https://github.com/adaptivecomputing/torque
我有这个 repo 的一个分支(起源):
https://github.com/spudstud/torque
新分支已添加到我想要拉入源的上游存储库,然后添加到我的本地计算机。
根据 GitHub 帮助,这应该很容易。我应该能够使用以下命令同步我的 fork。https://help.github.com/articles/syncing-a-fork
git fetch upstream
git merge upstream/master
不幸的是,我想要的上游分支(4.2.3、4.2.3.1、4.2.3.h2、4.2.3.h3)仍然没有出现在 origin
git clone git@github.com:spudstud/torque.git
cd torque/
git remote add upstream https://github.com/adaptivecomputing/torque.git
git remote -v
origin git@github.com:spudstud/torque.git (fetch)
origin git@github.com:spudstud/torque.git (push)
upstream https://github.com/adaptivecomputing/torque.git (fetch)
upstream https://github.com/adaptivecomputing/torque.git (push)
git fetch upstream
git checkout master
git merge upstream/master
git branch -a
* master
remotes/origin/2.5-dev
remotes/origin/2.5.12
remotes/origin/4.1-dev
remotes/origin/4.1.0
remotes/origin/4.1.4
remotes/origin/4.1.4-1648
remotes/origin/4.1.5
remotes/origin/4.1.5.1
remotes/origin/4.1.5.2
remotes/origin/4.2.0
remotes/origin/4.2.1
remotes/origin/4.2.2
**** 4.2.3, 4.2.3.1, 4.2.3.h2, 4.2.3.h3 should show up about here^ ****
...
remotes/origin/HEAD -> origin/master
remotes/origin/master
remotes/upstream/2.5-dev
remotes/upstream/2.5.12
remotes/upstream/4.1-dev
remotes/upstream/4.1.0
remotes/upstream/4.1.4
remotes/upstream/4.1.4-1648
remotes/upstream/4.1.5
remotes/upstream/4.1.5.1
remotes/upstream/4.1.6
remotes/upstream/4.1.6.h1
remotes/upstream/4.1.6.h2
remotes/upstream/4.2-dev
remotes/upstream/4.2.0
remotes/upstream/4.2.1
remotes/upstream/4.2.2
remotes/upstream/4.2.2.ufl
remotes/upstream/4.2.3
remotes/upstream/4.2.3.1
remotes/upstream/4.2.3.h2
remotes/upstream/4.2.3.h3
remotes/upstream/master
到目前为止,我所读到的任何内容都无法解释问题可能是什么:
解决方案 感谢答案,我想通了。我不明白我需要将更改推回分支:
git push origin 4.2.4
看来我想做的是“快进”我的叉子。GitHub 曾经有一个快进按钮,它会自动使您的分叉存储库与上游的Fast Forward Your Fork保持同步。看起来 GitHub 摆脱了快进功能(据我所知),所以我必须对每个分支重复这些步骤。