【问题标题】:how to push a existing android project to an organisation's repository?如何将现有的 android 项目推送到组织的存储库?
【发布时间】:2018-11-17 01:47:32
【问题描述】:
我正在开发 Android Studio,我想将我的 android 项目推送到组织的存储库,但每当我提交更改时,它会将项目上传到我的用户名目录而不是组织的存储库。
请以这个例子解释我 -
我的用户名-abc
组织名称-xyz
存储库名称-123
所以我想把我的项目上传到https://github.com/xyz/123
【问题讨论】:
标签:
android
git
android-studio
github
【解决方案1】:
在您组织的帐户下创建一个新存储库,然后将其添加为新远程:
git remote add newRemote https://github.com/organization/repo.git
然后,使用以下命令推送:
git push newRemote master
如果您希望将组织的 repo 设为默认 repo,则必须替换名为 origin 的远程:
git remote rm origin
git remote add origin https://github.com/organization/repo.git
您可以像这样列出所有当前配置的遥控器:
git remote -v