Visual studio/GIT : No tracked remote branch

后端 未结 2 481
攒了一身酷
攒了一身酷 2020-12-25 13:36

I just configured Visual Studio 2015 with a connection to GitHub. Unfortunately, it doesn\'t work to track the remote branch. I have 2 projects in the same solution, each ha

相关标签:
2条回答
  • 2020-12-25 13:57

    The UI doesn't make it very clear that you have to use Publish without adding a remote repo.

    If you add a remote first, Publish never becomes available and you get stuck in the "does not track a remote branch" state. I've just had the same trouble in VS2017.

    Wrong way:

    You might think that before you can sync to a remote, you have to tell Visual Studio about the remote. Don't do that.


    Right way:

    Instead, hit Sync:

    Visual Studio detects that there is no remote configured for the repo, and takes you to the Push dialog:

    Press the relevant Publish button, and an input box appears. This is the right place to configure Visual Studio with the URL of the remote repo.

    When the remote is added this way, Visual Studio recognizes the status of the remote repo so that it no longer thinks it's untracked. From now on, it enables all the sync/push functionality as expected.

    0 讨论(0)
  • 2020-12-25 14:16

    run this through command prompt in your local repo folder:

    git branch --set-upstream-to=origin/master master

    That will then enable you to "push" through team explorer in VS

    0 讨论(0)
提交回复
热议问题