Reputation: 13923
I have a local project on VS code and a private Repository with the same name on Github. Now, when I follow these steps
It says, Github repository alreadt exists as shown in the last image. Please guide me, how to publish to that existing Github Repository. I know a hack as:
But I want to know a proper short way.
Thanks!
Upvotes: 6
Views: 10176
Reputation: 141
Click on the source control icon and initialize the repository:
Afterwards, go to the 3 dot menu in the upper right corner of the source control sidebar:
Once you click on Add Remote, you can now add your repository url or github link and give any remote name like origin
alpha
beta
or anything you wish to and get going ...
In the similar way you can now remove your old github remote by selecting remove remote and then selecting your other remote which you want to remove
Upvotes: 5
Reputation: 103
After you committed, try to push directly. If you don't have a remote setted yet, Visual Studio Code should tell you to which repository you want to push into.
Upvotes: 2