7

I am attempting to use an existing GIT setup within VS2013 using Tools for Git extension.

I believe the repositories and remotes are setup correctly because I can do what I need to using GitShell -- this has not presented any difficulties.

I have a local repository and inside of Team Explorer the master branch is shown as an Unpublished Branch. When I right-click and choose Publish Branch a progress bar is displayed briefly and then the message:

Successfully published branch master to .

(please note the period '.' at the end)

But the branch remains in the Unpublished Branch section. Repeated attempts produce the same non-result.

enter image description here

What is wrong here? What can do I break out of this catch-22?

David Tansey
  • 5,813
  • 4
  • 35
  • 51

1 Answers1

16

This problem was the result of a incorrect / partial Git configuration.

In my Git configuration file, the remote definition for origin did not have any fetch entry.

[remote "origin"]
    url = http://DM-BUILD/git/StarSchemaMetadata.git

[branch "master"]
    remote = origin
    merge = refs/heads/master

With the fetch entry was added as shown here:

[remote "origin"]
    url = http://DM-BUILD/git/StarSchemaMetadata.git
    fetch = +refs/heads/*:refs/remotes/origin/*

[branch "master"]
    remote = origin
    merge = refs/heads/master

The configuration problem has been corrected and now I can successfully Publish an Unpublished Branch using VS Tools for Git extension.

David Tansey
  • 5,813
  • 4
  • 35
  • 51
  • 4
    Thanks, in my case it was [branch "master"] entry missing, adding it solved VS2013 syncing issues. – Sergej Popov Mar 19 '15 at 00:29
  • 2
    To solve the problem from the command line: git branch -u origin/[branchname]. Make sure you are already on [branchname], and replace it with the name of your branch of course (master by default). This will set the current branch to track the remote branch origin/[branch]. – personne3000 Apr 15 '15 at 06:14
  • All three of the projects that I've pulled from GitHub are missing the [branch "master"] section. – Rhyous May 09 '15 at 01:37
  • This helped me, thanks. I think this happens if you initially clone using a tool other than VS. – user381624 Aug 27 '15 at 13:36