Questions tagged [remote-branch]

133 questions
7300
votes
35 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. Now I'm trying to check out the remote test branch. I've tried: git checkout test which does nothing git checkout…
Juri Glass
  • 76,369
  • 8
  • 31
  • 46
4370
votes
42 answers

How to clone all remote branches in Git?

I have a master and a development branch, both pushed to GitHub. I've cloned, pulled, and fetched, but I remain unable to get anything other than the master branch back. I'm sure I'm missing something obvious, but I have read the manual and I'm…
Peter Coulton
  • 50,723
  • 11
  • 51
  • 70
773
votes
11 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
  • 101,562
  • 37
  • 148
  • 155
742
votes
19 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
  • 60,042
  • 58
  • 173
  • 260
608
votes
5 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
  • 16,106
  • 13
  • 46
  • 107
470
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
  • 90,705
  • 23
  • 91
  • 118
389
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
  • 4,959
  • 4
  • 22
  • 28
200
votes
4 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
  • 65,169
  • 19
  • 130
  • 176
155
votes
21 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
  • 5,922
  • 3
  • 27
  • 50
143
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
  • 1,919
  • 4
  • 19
  • 22
113
votes
2 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
  • 6,111
  • 14
  • 55
  • 94
84
votes
5 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
  • 297,790
  • 101
  • 558
  • 777
38
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,170
  • 28
  • 33
33
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,384
  • 2
  • 23
  • 38
30
votes
3 answers

Refresh remote Git branches in Android studio

There is a new branch in the remote repository, but it does not appear in the git branches in android studio. How can I refresh that list to show the new branch? I have tried git branch -r but new branch is not showing in the list.
Firzan Shaikh
  • 467
  • 1
  • 5
  • 11
1
2 3
8 9