0

我已经将 GitHub 上的上游项目分叉到我在 Github 上的原始存储库和本地主副本。

我也想同步上游分支,所以我跑了:

$ git fetch upstream

其中添加了新分支:

$ git branch -a
* master
remotes/origin/HEAD -> origin/master
remotes/origin/new/one
remotes/origin/new/two
remotes/origin/master
remotes/upstream/new/one
remotes/upstream/new/two
remotes/upstream/master


$ git remote show upstream
   HEAD branch: master
  Remote branches:
    new/one   tracked
    new/two tracked
  master            tracked
    Local ref configured for 'git push':
  master pushes to master (local out of date)

所以我跑了:

$ git merge upstream/new/one
35 files changed, 1194074 insertions(+), 119 deletions(-)
$ git branch -a

仍然只显示没有分支的本地master

$ git checkout -b one upstream/new/one
$ git checkout -b two upstream/new/two
$ git branch -a
  one
  master
* two
  remotes/origin/HEAD -> origin/master
  remotes/origin/new/one
  remotes/origin/new/two
  remotes/origin/master
  remotes/upstream/new/one
  remotes/upstream/new/two
  remotes/upstream/master
$ git merge upstream/new/two
Already up-to-date.

虽然我可以在本地看到主文件,但我无法访问似乎没有在本地同步的分支。

如何在本地计算机上访问它们?

4

0 回答 0