Reputation: 10163
I have git integration set up with Visual Studio Code. I can commit just fine (so I think my credentials are set up correctly), and I can use git push
from the command-line.
But, for some reason, Sync
, Pull
, and Push
are all disabled (greyed out) in the Git section. What am I missing?
Edit: I'm on Ubuntu 12.04, if that matters.
Upvotes: 8
Views: 11409
Reputation: 1098
I had this issue with Visual Studio 2022. Simply restarting Visual Studio solved it for me.
Upvotes: 12
Reputation: 193
I simply clicked the bottom right branch menu, as the snapshot below, then click push.
Upvotes: 1
Reputation: 1250
Another soludtion could be renaming your remote repository to origin
:
Upvotes: 4
Reputation: 22298
git branch --set-upstream-to origin/my_branch
Or
git branch -u origin/my_branch
Upvotes: 15
Reputation: 1332
Edit: I'm on Ubuntu 12.04, if that matters.
It, in fact, does!
I just had this problem today, and solved it only because I had it working in Windows, but broken on Linux, and the repos were setup identically. Ubuntu's apt-get repos don't contain an up-to-date version of the git tools (it's a whole major version behind, wtf?). My guess is they are using flags that differ between the versions when they are getting the remote repo information.
Here's what to do in Ubuntu to add an alternate repository that contains the latest versions of git, and install it:
$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt-get update
$ sudo apt-get install git
Restart VS Code, and all your git options are now properly enabled.
Upvotes: 0