【发布时间】:2010-11-16 08:23:12
【问题描述】:
我在 GitHub 上的某个位置有我的项目,git@github.com:myname/oldrep.git。
现在我想将我的所有代码推送到其他位置的新存储库git@github.com:newname/newrep.git。
我使用了命令:
git remote add origin git@github.com:myname/oldrep.git
但我收到了这个:
致命:远程源已经存在。
【问题讨论】:
-
给出命令的输出 $> git remote -v show
-
如果您知道旧版本库的 URL,一个好方法是在新创建的版本库底部使用 "import from another repository"。
-
这里提出了类似的问题:stackoverflow.com/questions/2432764/…
-
如果你想保留原来的遥控器,你可以简单地使用不同的名字
git remote add origin2 ....,但是如果你只需要推送一次而不修改repo配置那么你可以只需做git push git@github.com:user/another-project.git master:master。
标签: git github git-push git-remote