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 has its own repository. For each of them, - I only have one branch (Master) - I checked that the remote branch was set correctly (Push and fetch have the same value). I eventually reset the branches - In Synchronization, only "Fetch" is not greyed out. Clicking on it doesn't synchronize. Under "Incoming Commit" is written "The current branch does not track a remote branch". - When working with Git GUI, it works fine, I can easily fetch and push.
Please ask if you need more information.
Thanks
Niko
Tracking a remote branch means you want to automatically merge changes from the remote branch you're tracking into your local branch.
Simply delete your remote tracking branch: git branch -d -r origin/<remote branch name> (This will not delete the branch on the remote repo!) That will make any push/pull completely unaware of origin/.
You can check tracking branches by running the “git branch” command with the “-vv” option. We can set the upstream branch using the “git push” command. $ git push -u origin branch Total 0 (delta 0), reused 0 (delta 0) * [new branch] branch -> branch Branch 'branch' set up to track remote branch 'branch' from 'origin'.
Find the remote branch in remotes -> origin , then double-click that branch to get it selected locally.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With