Reputation: 53
VS 2017 Team Explorer GIT "Push Branch" is Grayed out for me. I create a new local branch from a remote branch with no tracking and then I try to create a remote branch with the same name as the local branch by clicking on "Push Branch". Why would this option be grayed out for me?
Upvotes: 3
Views: 8073
Reputation: 17957
Rename one of your remotes to "origin" with this command:
git remote rename your-remote-name-goes-here origin
Then you should be able to Push, Pull, and Fetch in Visual Studio. These options will no longer be grayed out.
Upvotes: 3
Reputation: 175
I place it here, as someone like me will search again for that, I have resolved by doing branch Rebase. Commit your changes before. And then:
Probably it happens after you have manipulated remote repository settings.
In another case i just deleted all origins and created them again
Another addition. Be sure that you always has remote with "origin" name, that's another problem I faced right now, during migration of my projects.
Upvotes: 2
Reputation: 38096
The direct way to push a new created local branch to VSTS git repo by VS is clicking push branch button directly on local branch (don’t need to create the same branch in remote manually).
Detail steps as: VS -> Team explorer -> Branches -> right click the local branch -> Push branch -> then the local branch is pushed to remote.
Since you have already created the same branch on remote, you can fetch first and then push: Team explorer ->Sync -> Fetch -> push.
when you clone the remote repo (no matter on VSTS or bitbucket) again, and siwtch to the new created branch, the branch willexist in remotes/origin
, so you can push directly.
Upvotes: -2