1

I ran these commands, but the new branch that I fetched from Github doesn't show up when I run git branch after running git fetch origin:

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 

Is there any good reason why the new branch that was clearly fetched from the remote (origin) doesn't show up when I run the git branch command?

2
  • git branch -r—are you including the -r? Commented Jul 16, 2015 at 23:39
  • 1
    As mentioned above, git branch -r shows the remote branches, but that is remote branches only. You can use git branch -a to list all branches, both local and remote. Commented Jul 16, 2015 at 23:45

1 Answer 1

1

It will have brought down the branch as a remote tracking branch

origin/<branchname> 

you can view it with

git branch -r 

If you want to work in it, you should create a local branch of the same name from it.

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

(In some versions of Git you may be able to just git checkout <branchname> and git will figure out that you want to create the new local branch from the remote tracking branch)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.