错误提示:fatal: remote origin already exists.
如果输入$ git remote add origin git@github.com:(github帐号名)/gitdemo(项目名).git
提示出错信息:fatal: remote origin already exists.
解决办法如下:
1、先输入$ git remote rm origin
2、再输入$ git remote add origin git@github.com:(github帐号名)/gitdemo(项目名).git 就不会报错了!
3、如果输入$ git remote rm origin 还是报错的话,error: Could not remove config section 'remote.origin'. 我们需要修改gitconfig文件的内容
4、找到你的github的安装路径,我的是C:\Users\ASUS\AppData\Local\GitHub\PortableGit_ca477551eeb4aea0e4ae9fcd3358bd96720bb5c8\etc
5、找到一个名为gitconfig的文件,打开它把里面的[remote "origin"]那一行
删掉就好了!
错误提示:fatal: 'origin' does not appear to be a git repository
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
翻译: 致命:“origin”不是一个 git 存储库
致命:无法读取远程存储库
请确定你有正确的访问权力,并且 存储库存在
解决方案: 1. 首先,检查你的起源是设定的运行
git remote -v
显示
orgin git@github.com:xxx/xxx.git (fetch)
orgin git@github.com:xxx/xxx.git (push)
"origin" 不存在
2.重命名它,或改变URL,删除它,然后添加正确的一个。
git remote remove orgin
3. 增加一个
git remote add origin git@github.com:xxx/xxx.git
4. git push origin master
错误提示:git push.default Update were rejected because a pushed branch tip is behand remote
使用以下命令:
git config --global push.default current