2016-08-01 100 views
0

我使用WordPress Sage,因此我为每个项目克隆他们的回购。对于我目前的项目,我想推向我的回购。我应该删除所有Git文件并重新开始,还是可以让它们以某种方式告知Git关于我的回购?从回购克隆然后推送到另一个

+1

投票关闭为http://stackoverflow.com/questions/2432764/change-the的副本-uri-url-for-a-remote-git-repository – bahrep

回答

1

只需添加一个新的遥控器。

git remote add myrepo [email protected] 
git push myrepo mybranch 

如果你想mybranch总是推到myrepo,将跟踪信息:

git push -u myrepo mybranch 
+0

在做“git remote add origin https://github.com/my_account/my_repo.git”时,我得到“致命的:远程原点已经存在”。我试图删除我的回购,但仍然有同样的错误。任何想法为什么? – drake035

+0

@ drake035不要将它命名为“origin”。从字面上命名为“myrepo”。 – blue112

+0

谢谢,工作(这次没有错误信息)。然后我做了“git push”,它试图推动旧回购。呃:( – drake035

1

您应该更改远程回购。见Git Basics | Working with Remotes

git remote add origin /path-or-URL/to-repo

+0

在做“git remote add origin github.com/my_account/my_repo.git”;我得到“致命的:远程原点已经存在”。 – drake035

+0

@ drake035用其他名称替换原点。 – bahrep