Git fetch远程拉入新分支,但新分支不显示

时间:2015-07-16 23:34:09

标签: git github

我运行了这些命令,但是在运行git branch之后运行git fetch origin时,我从Github获取的新分支没有出现:

CACSVML-13295:smartconnect amills001c$ git fetch origin
remote: Counting objects: 426, done.
remote: Compressing objects: 100% (223/223), done.
remote: Total 426 (delta 269), reused 287 (delta 188)
Receiving objects: 100% (426/426), 113.77 KiB | 76.00 KiB/s, done.
Resolving deltas: 100% (269/269), done.
From github.csv.comcast.com:Baymax/smartconnect
 * [new branch]      enrichmentasync-module -> origin/enrichmentasync-module
 * [new branch]      github_master_now -> origin/github_master_now
 * [new branch]      master_next_localMermoryCache -> origin/master_next_localMermoryCache
 * [new tag]         0.0.4      -> 0.0.4
 * [new tag]         0.0.5      -> 0.0.5
CACSVML-13295:smartconnect amills001c$ git branch
  github_master_now
  master
* master_next
  master_with_quick_fix_for_prod
  mocha_deep_test
  priya_testing_branch

当我运行git branch命令时,为什么从远程(原点)清楚地取出的新分支没有显示出来有什么好的理由?

1 个答案:

答案 0 :(得分:1)

它将把分支机构作为远程跟踪分支机构

origin/<branchname>

您可以使用

进行查看
git branch -r

如果你想使用它,你应该从中创建一个同名的本地分支。

git checkout -b <branchname> origin/<branchname>

(在某些版本的Git中你可能只能git checkout <branchname>,而git会发现你想要从远程跟踪分支创建新的本地分支)