1

I would like to share my problem about Git and GitHub. I want to track those new branches that have been added in remote using git so what I did is: git branch -r to see those remotes branches but unfortunately what appears in my Git was only those old branches. I can even track those deleted branches from remote. DO you have any ideas about the causes of it? I would be glad if you will share it to me. Thank you.

LirpaEcarg
  • 11
  • 2

1 Answers1

0

unfortunately what appears in my Git was only those old branches.
I can even track those deleted branches from remote.

Deleted branches on the remote repo would be pruned on the local repo only with a git fetch --prune (which you can automate since git 1.8.5 with git config remote.origin.prune true)

But if you don't see the new branches, it could mean:

  • your remote repo 'origin' doesn't reference the right GitHub repo (it could point to a fork instead of the original one). See git remote -v for checking the url.
  • or you have some kind of error communication when doing the fetch.

But after a fetch, git br -avv should show you all your branches, including the remote tracking one, stored in their remote repo namespaces (remotes/origin/xxx)

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I tried already the git fetch --prune but it seems that I can't successfully fetch the remote repo/branch because when the objects are still compressing, it will only stop or hang at 53% and it wont continue anymore.. – LirpaEcarg Mar 22 '14 at 12:18
  • @LirpaEcarg that is your issue, then, which is why I wrote "you have some kind of error communication when doing the fetch". Looks like I guessed it right. Could you edit your question with the exact output you get when doing a fetch? Also, if possible, what is the url of the GitHub repo you are trying to fetch? Do you reproduce the same issue if you are trying and re-clone that repo again in another local folder (`git clone`)? – VonC Mar 22 '14 at 12:21