About a week ago Git support was added to Visual Studio 2012 and Team Foundation Service. I've been playing around with it a bit and wanted to publish a local repository to my team project. It's described in step 2 on the Team Foundation Service website:
Now I've been doing the exact same thing, but I don't get the "Publish to ..." context item. Could this be a bug or am I missing something?
I was having the same problem. I don't know why.
However, after a bit of playing around, I managed to get the following working. Disclaimer: can't guarantee this is actually the correct way to do it. It may bork things further. And whether it does the same as what the missing 'Publish' menu item is supposed to do, I have no idea. Use at your discretion...
e.g.
[remote "origin"]
url = https://user.visualstudio.com/DefaultCollection/_git/YourRepo
fetch = +refs/heads/*:refs/remotes/origin/*
This should hopefully push your local repo to your TFS remote as origin.
From here things seem to be working for me -- the code is up in my TFS web interface at least, and I can push commits to it. I can add backlog items etc. I'm new to TFS though so not sure if it's actually all working as it should be.
I was just having the same problem, and the answer by ngm didn't work; I had to do the opposite. The [remote "origin"] section was already in my .git/config file, however the project code wasn't uploaded to TFS.
To fix it I just deleted that section from the config file, then restarted Visual Studio and followed the official instructions.
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