Git - No such remote ‘origin‘(git remote set-url origin ‘xxx.git‘)

Posted 程序员牧码

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Git - No such remote ‘origin‘(git remote set-url origin ‘xxx.git‘)相关的知识,希望对你有一定的参考价值。

报错分析

git remote set-url 是修改远程的 url 的命令,但这里有一个大前提

要原先就有一个远程 URL 才能修改生效,说明项目根本就没设置过远程地址

解决方案

所以直接增加一个远程 URL 即可

git remote add origin "xxx.git"

以上是关于Git - No such remote ‘origin‘(git remote set-url origin ‘xxx.git‘)的主要内容,如果未能解决你的问题,请参考以下文章

git报错remote: error: cannot run hooks/post-receive: No such file or directory

remote: fatal: could not read Username for 'http://spapa.wicp.net:3000': No such device ors(

ssh -vT git@github.com get “ No such file or directory” 错误

no git.exe found. TortoiseGit requires a git.exe for its operations(e.g.,such as provided by the Gi

git公钥出错"//.ssh/id_rsa" failed: No such file or dir

解决fatal: cannot run .git/hooks/commit-msg: No such file or directory的问题