Questions tagged [remote-branch]
142 questions
8468
votes
43 answers
How do I check out a remote Git branch?
Somebody pushed a branch called test with git push origin test to a shared repository. I can see the branch with git branch -r. How do I check out the remote test branch? I've tried:
git checkout test, which does nothing
git checkout origin/test…

Juri Glass
- 88,173
- 8
- 33
- 46
4732
votes
48 answers
How do I clone all remote branches?
My master and development branches are tracked remotely on GitHub. How do I clone both these branches?

Peter Coulton
- 54,789
- 12
- 54
- 72
875
votes
22 answers
How do I list all remote branches in Git 1.7+?
I've tried git branch -r, but that only lists remote branches that I've tracked locally. How do I find the list of those that I haven't? (It doesn't matter to me whether the command lists all remote branches or only those that are untracked.)

James A. Rosen
- 64,193
- 61
- 179
- 261
857
votes
6 answers
When does Git refresh the list of remote branches?
Using git branch --all shows all remote and local branches. When does Git refresh this list?
On pull/push? And how do I refresh it using Git Bash?

BendEg
- 20,098
- 17
- 57
- 131
834
votes
13 answers
How do you remove an invalid remote branch reference from Git?
In my current repo I have the following output:
$ git branch -a
* master
remotes/origin/master
remotes/public/master
I want to delete remotes/public/master from the branch list:
$ git branch -d remotes/public/master
error: branch…

cmcginty
- 113,384
- 42
- 163
- 163
477
votes
11 answers
Git checkout: updating paths is incompatible with switching branches
My problem is related to Fatal Git error when switching branch.
I try to fetch a remote branch with the command
git checkout -b local-name origin/remote-name
but I get this error message:
fatal: git checkout: updating paths is incompatible with…

Ikke
- 99,403
- 23
- 97
- 120
463
votes
4 answers
What are the differences between git remote prune, git prune, git fetch --prune, etc
My situation is this... someone working on the same repo has deleted a branch from his local & remote repo...
Most people who have asked about this kind of problem on Stack Overflow, or other sites have the issue of branches still showing in their…

gogogadgetinternet
- 5,719
- 4
- 24
- 28
261
votes
33 answers
Can't push to remote branch, cannot be resolved to branch
I migrated my repos from Bitbucket or Github. I don't think this matters but it's the only thing different. For a little while, I had two remotes set up:
origin: bitbucket
github: github
Then I removed both and pointed origin to github:
git remote…

jleach
- 7,410
- 3
- 33
- 60
218
votes
6 answers
Git: which is the default configured remote for branch?
I have a remote bare repository hub. I work only in the master branch.
The last sentence of this error message below makes me wonder: How do I find out which is the "default configured remote for your current branch"? And how do I set…

leonbloy
- 73,180
- 20
- 142
- 190
194
votes
9 answers
Git: Cannot see new remote branch
A colleague pushed a new remote branch to origin/dev/homepage and I cannot see it when I run:
$ git branch -r
I still see preexisting remote branches.
I assume this is because my local remote refs are not up-to-date hence when I ran a git pull…

hybrid9
- 2,466
- 4
- 24
- 24
192
votes
13 answers
Listing each branch and its last revision's date in Git
I need to delete old and unmaintained branches from our remote repository. I'm trying to find a way with which to list the remote branches by their last modified date, and I can't.
Is there an easy way to list remote branches this way?

Roni Yaniv
- 57,651
- 5
- 19
- 16
163
votes
5 answers
Update a local branch with the changes from a tracked remote branch
I have a local branch named 'my_local_branch', which tracks a remote branch origin/my_remote_branch.
Now, the remote branch has been updated, and I am on the 'my_local_branch' and want to pull in those changes. Should I just do:
git pull origin…

skyork
- 7,113
- 18
- 63
- 103
146
votes
6 answers
fatal: The upstream branch of your current branch does not match the name of your current branch
After doing a checkout of the remote branch releases/rel_5.4.1 using the Git GUI, I'm seeing this unexpected error message when I try to push:
fatal: The upstream branch of your current branch does not match
the name of your current branch. To push…

Aaron Digulla
- 321,842
- 108
- 597
- 820
50
votes
4 answers
git pull all branches from remote repository
How do I pull all of the remote branches to my own repository?
if I type:
git branch -a
I get a long list of branches, but if I type:
git branch
I see only 2 of them.
How do I pull ALL branches into my local list?
I know I can do:
git checkout…

MarcinWolny
- 1,600
- 2
- 27
- 40
41
votes
2 answers
How do I use Git's interactive rebase with a local-only repository (no remote / origin)?
I use git as a local source control system mostly for history and diff tracking. I still want to use rebase to do fixup / squash on WIP commits that I will make periodically. When I try to do git rebase -i though, I get the following:
There is no…

mcw
- 3,500
- 1
- 31
- 33