current branch does not have an upstream branch co

2019-07-04 01:48发布

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?

2条回答
小情绪 Triste *
2楼-- · 2019-07-04 02:20

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)

查看更多
老娘就宠你
3楼-- · 2019-07-04 02:35

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

查看更多
登录 后发表回答