0

I clone a remote repo which has a master branch, and a feature-branch

But when I do "git log --graph --oneline --decorate --all", I only see:

* e58e7f1 (HEAD -> master, origin/master, origin/HEAD)
| * 714bebe (origin/feature-readme)
| * 7250765
|/
* 7cd4343
* 8c6c754
$ git branch
* master

It appears that feature-readme is not a local branch? After I do "git checkout feature-readme", then it looks like this:

* e58e7f1 (master, origin/master, origin/HEAD)
| * 714bebe (HEAD -> feature-readme, origin/feature-readme)
| * 7250765
|/
* 7cd4343
* 8c6c754
$ git branch
* feature-readme
  master

How come only after "git checkout feature-readme", only 714bebe becomes a local branch (feature-readme)?

roht
  • 19
  • 2
  • When you clone the repo, you should get all branches, but they will remain in remotes. If you want to work on them, you need to create your local branches to track the remote branches. See this answer for more info: https://stackoverflow.com/questions/520650/make-an-existing-git-branch-track-a-remote-branch – SnowGroomer Jul 21 '20 at 16:05
  • https://stackoverflow.com/search?q=%5Bgit%5D+clone+all+branches – phd Jul 21 '20 at 16:06
  • Note that the various answers on the duplicate have various errors. The *comments* on the accepted answer contain the keys to understanding what's going on. – torek Jul 21 '20 at 20:33

0 Answers0