m00nbeam360
m00nbeam360

Reputation: 1377

Migrate local Git repo to Visual Studio Online from IDE

I created a new Team Project on Visual Studio Online that I have connected to in Visual Studio 2013. Using the IDE, I cloned a local Git repo (that was pulled down from GitHub) into the Local Git Repositories section.

When I went through the documentation on Visual Studio's website, it showed an option to "Publish to {Team Project}."

enter image description here

Mine doesn't show this:

enter image description here

And it looks like this has been a problem in the past (others have needed to change the .git/config file). Has this been fixed yet so I can use the IDE completely? Or am I missing something?

Upvotes: 7

Views: 6504

Answers (2)

x0n
x0n

Reputation: 52430

The answer marked as correct doesn't appear to be correct. To push an existing local repo to a VSO repo involves following:

git remote add origin https://<NAME>.visualstudio.com/DefaultCollection/_git/<PROJECT> git push -u origin --all

This assumes you've already created <PROJECT> in VS Online as a new team project using Git as the source control strategy.

Upvotes: 8

jessehouwing
jessehouwing

Reputation: 114651

This publish option is only shown when you are connected to a Team Project and when the remote uri of the git repository is set to the TFS uri.

To fix this you can manually edit the git files, but I tend to open the Git Command Prompt (right-click the repo and choose Open Command prompt.

On the command line enter:

git remote set-url origin http://[server]:[port]/tfs/[projectcollection]/_git/[ProjectName]

git pull

[[ resolve any merge issues ]]

git push

Upvotes: 6

Related Questions