4

I'm trying to pull the latest changes for a branch in Visual Studio Team Explorer for Git but the Pull url is disabled and the "Incoming Commits" section displays a message hat says "Current branch does not have an upstream branch configured. There are no incoming commits for non-tracking branches." Any idea what the problem might be or how to fix?

Greg Brattle
  • 421
  • 1
  • 7
  • 20
  • The problem is that your local branch does not have a "remote" branch configured; e.g. it's not "hooked up" to view a remote branch as the source to pull from. I'm not sure how to set this up using Visual Studio, but [this question](http://stackoverflow.com/questions/520650/make-an-existing-git-branch-track-a-remote-branch) shows how to do it from the command line. – BJ Myers Mar 28 '16 at 19:25

2 Answers2

5

I use following command to fix the issue: git branch --set-upstream-to=origin/master master

Ahsin Anwar
  • 73
  • 2
  • 7
2

This can be fixed using git commands, I am not sure about the tool you are using with with visual

You can go to the your working branch and find out all the branch names using following command

git branch --all

This will give you list of branches you have including remote branches and current branch, usually current branch will be in green color and red color is used to list the remote branches which you need to set as upstream during push. You can set upstream using following command while you do push

git push --set-upstream origin nameOfBranch

nameofBranch: Should be one your current working branch points to and the same branch you have in remote ( set as origin)

Manoj
  • 327
  • 1
  • 11