tags:

views:

29

answers:

2

I have two directories on my local machine pointing to the same remote git repository. When I issue the command git branch -r in one of the directories I get a longer list of remote branches then in the other directory. How is that possible ?
It seems that some of the remote branches are 'hidden' in one directory and are visible in the other.

A: 

Are both repositories up-to-date? Try running git fetch and see if that fixes it.

mkarasek
+1  A: 

I think you should fetch and prune:

prune 
Deletes all stale tracking branches under <name>. These stale branches have already been removed from the remote repository referenced by <name>, but are still locally available in "remotes/<name>". 

With --dry-run option, report what branches will be pruned, but do not actually prune them.

With this commandlines:

git fetch
git remote prune origin
Andreas Rehm
These two commands can be shortened to `git fetch -p`.
svick