在'git push'上,远程原点已经存在于一个新的仓库中 [英] Remote origin already exists on 'git push' to a new repository

查看:150
本文介绍了在'git push'上,远程原点已经存在于一个新的仓库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在GitHub的某个位置上有我的项目, git@github.com:myname / oldrep.git



现在我想将所有代码都推送到其他位置的新存储库, git@github.com:newname / newrep.git



我使用了以下命令:

lockquote
git remote add origin git@github.com myname / oldrep .git


但我收到此消息:


起源不可用。 起源是一个不属于命令的约定。 origin是远程仓库的本地名称。



例如,您也可以编写:

  git remote add myorigin git@github.com:myname / oldrep.git 
git remote add testtest git@github.com:myname / oldrep.git

请参阅手册:

http://www.kernel.org/pub/software/scm/git/docs/git-remote .html



删除您输入的远程存储库:

  git remote rm origin 

如果你想要的话,origin就是远程仓库的名字到
删除上游远程:

  git remote rm upstream 


I have my project on GitHub at some location, git@github.com:myname/oldrep.git.

Now I want to push all my code to a new repository at some other location, git@github.com:newname/newrep.git.

I used the command:

git remote add origin git@github.com:myname/oldrep.git

but I am receiving this:

fatal: remote origin already exists.

解决方案

You are getting this error because "origin" is not available. "origin" is a convention not part of the command. "origin" is the local name of the remote repository.

For example you could also write:

git remote add myorigin git@github.com:myname/oldrep.git  
git remote add testtest git@github.com:myname/oldrep.git

See the manual:

http://www.kernel.org/pub/software/scm/git/docs/git-remote.html

To remove a remote repository you enter:

git remote rm origin

Again "origin" is the name of the remote repository if you want to remove the "upstream" remote:

git remote rm upstream

这篇关于在'git push'上,远程原点已经存在于一个新的仓库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆