Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to publish an organization repository in Github using VSCode

I added my files and commited with no problem. The problem is that when I press "Publish to Github" the only options there appear are private and public repositories as individual. But I would like to publish as an organization. enter image description here

like image 719
z_tjona Avatar asked May 12 '21 17:05

z_tjona


2 Answers

Workaround for the lack of functionality:

You can add your project to a local repository by pressing "Initialize Repository" in your "Source Control" tab.

After that, go to Github and make a new empty organisation repository.

Now you can hit F1 and type "Add Remote". You can now choose "Git: Add remote..." and then paste the repository's URL, instead of adding from Github.

Now committing and pushing should work as expected.

like image 165
zoku Avatar answered Oct 19 '22 04:10

zoku


I just wanted to add another workaround as I came across the same issue.

  1. Publish as a private or public repository within your personal GitHub instance
  2. Open the repository and go to "settings" (GitHub UI) enter image description here
  3. Use the "transfer ownership" option to transfer the repository to your organization. enter image description here
  4. Done. As from my experience tools like VS Code and VS 2022 will not loose the connection to the repository and you can still commit code without further changes (Assuming the correct permissions of the organization are provided to you).
like image 1
JCoordes Avatar answered Oct 19 '22 04:10

JCoordes