Tuesday, April 22, 2014

TFS Git: Sync button not enabled

For a project I’m using the TFS Git integration. After creating a local branch and committing some changes, I couldn’t sync my changes to the remote TFS repo. The ‘Sync’ button was disabled on the Unsynced Commits screen.

clip_image002

The reason the ‘Sync’ button was disabled is that although I had the branch created locally, this branch didn’t exist yet on the remote TFS repo. I had to create this branch first. This is not possible from inside Visual Studio (yet).

So you have to go to a command prompt and execute the following command to push the current branch and set the remote as upstream:

git push --set-upstream origin new_branch

2 comments:

Gishu said...

+1 That fixed it.. I'm going back to the console :)

Mew said...

Whoa, thanks! That fixed my problem.