[英]How do I upload a repository directly to a GitHub Organization?
I am unsure whether I've followed this process correctly.我不确定我是否正确地遵循了这个过程。 I created a project repository on my IDE PyCharm, and tried to upload into a specific GitHub organization that I'm in. On Pycharm, it gives me the option of sharing the code to GitHub.
I created a project repository on my IDE PyCharm, and tried to upload into a specific GitHub organization that I'm in. On Pycharm, it gives me the option of sharing the code to GitHub. When I do this, it creates a public repository in my gitHub account but not directly in the organization;
当我这样做时,它会在我的 gitHub 帐户中创建一个公共存储库,但不是直接在组织中; therefore, I have to clone that one and import it separately in the organization.
因此,我必须克隆那个并在组织中单独导入它。 Is this correct process or is there a way I can import it directly in the organization from my IDE?
这是正确的过程还是有办法从我的 IDE 直接将其导入组织中? Do people generally create a repository and then upload/commit files separately from their IDE or am I taking the longer route?
人们通常会创建一个存储库,然后与他们的 IDE 分开上传/提交文件,还是我采取更长的路线?
Any advice would be appreciated.任何意见,将不胜感激。
The easy way to do this using only the GUI/IDE:仅使用 GUI/IDE 的简单方法:
Create a project in PyCharm named your-project
在 PyCharm 中创建一个名为
your-project
Go to your GitHub organization page and click New and name the repo your-project
转到您的 GitHub 组织页面并单击 New 并将 repo 命名为
your-project
In PyCharm, under the "Git" menu click "Manage Remotes" instead of clicking "GitHub"在 PyCharm 中,在“Git”菜单下单击“管理遥控器”而不是单击“GitHub”
In the popup, click "+" and add https://github.com/organization/your-project.git
在弹出窗口中,单击“+”并添加
https://github.com/organization/your-project.git
The default PyCharm "push" will now upload to your GitHub organization's repo.默认的 PyCharm “推送”现在将上传到您的 GitHub 组织的存储库。
I found a workaround similar to that proposed by @Nathan, though I'm not sure it's the cleanest way (any suggestion to improve is welcome):我找到了类似于@Nathan 提出的解决方法,但我不确定这是最干净的方法(欢迎提出任何改进建议):
my_pycharm_project
)my_pycharm_project
) $ git remote add origin https://github.com/organization/my_pycharm_project.git
master
branch and not into the main
branchmaster
分支而不是main
分支Of course it would be cleaner to push to the main
branch, but I didn't find a way to do this.当然推送到
main
分支会更干净,但我没有找到这样做的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.