Git 删除远程分支报错 error: Could not remove config section 'remote.origin' 解决办法
来源:互联网 发布:淘宝关联页是什么 编辑:程序博客网 时间:2024/05/02 02:31
这是我的Github新创建的一个Repository
echo # springDemo >> README.mdgit initgit add README.mdgit commit -m "first commit"git remote add origin https://github.com/xuxinpie/springDemo.gitgit push -u origin master
上面无非就是将本地工程同步到github上, 但再使用git remote add origin的时候可能会出现的如下错误
$ git remote addorigin git@github.com:xuxinpie/springDemo.git
错误提示:fatal: remote origin already exists.
解决办法:
$ git remote rm origin
然后在执行:$ git remote add origin git@github.com:xuxinpie/springDemo.git 就不会报错误了
如果输入$ git remote rm origin 还是报错的话,error: Could not remove config section 'remote.origin'. 我们需要修改gitconfig文件的内容
找到你的github的安装路径,我的是C:\Users\ASUS\AppData\Local\GitHub\PortableGit_ca477551eeb4aea0e4ae9fcd3358bd96720bb5c8\etc
找到一个名为gitconfig的文件,打开它把里面的[remote "origin"]那一行删掉就好了!
但是实际是我依然存在问题, 因为我的目录下gitconfig根本没有这一行,发现网上的解决方法都无法解决我的问题,自己思考了一下:
发现问题存在于自己的eclipse中的git插件,里面配置了remote origin, 所以每次操作的时候都会走默认的远程分支。
解决办法:打开eclipse-->windows-->perference-->Git-->Configuration
里面的User Settings里面删除对应的remote origin项(我的已删除,可以脑补一下)
删除之后再git bash里面重新$ git remote rm origin 成功。希望之前在eclipse中使用git插件配置过remote origin的同志们注意下,不要再踩这个坑了,
- Git 删除远程分支报错 error: Could not remove config section 'remote.origin' 解决办法
- git删除远程remote分支
- Windows 下git 环境搭建 与Git could not read from remote reposito问题处理Could not remove config ,gitHup删除仓库
- git上找不到远程分支,直接切换报错error: pathspec 'origin/XXX' did not match any file(s) known to git.
- git remote prune origin删除本地有但在远程库已经不存在的分支
- git 删除远端分支 报错remote refs do not exist的解决方法
- git切换分支报错:error: pathspec 'origin/XXX' did not match any file(s) known to git.
- git删除远程分支报错
- git远程删除分支后,本地remote tracking还有
- error: could not lock config file .git/config: 权限不够
- 解决git提交报错:fatal: remote origin already exists.
- git push -u origin master 出错 \Permission denied (publickey). fatal: Could not read from remote repo
- git 修改远程仓库 remote origin
- android studio删除依赖后添加依赖报错Error:Project with path 'XXXX' could not be found解决办法
- [已解决]Android studio git报错 could not read from remote repository
- Git提示fatal: remote origin already exists解决办法:之前添加过远程库
- git创建:error: could not lock config file
- 新建远端分支,git branch & git remote & origin master
- POJ 题目2083 Fractal(分治)
- Unsafe code may only appear if compiling with /unsafe
- The 15th Zhejiang University Programming Contest
- NSFileManager
- lighttpd 配置文件
- Git 删除远程分支报错 error: Could not remove config section 'remote.origin' 解决办法
- iOS——越狱和未越狱iPhone打包测试
- mac 下使用Xcode 5.1 编译Vmime笔记
- 移植ntp服务到arm-linux平台
- # less(less is more, Than# less(less is more, Than css)
- 如何将javaweb项目部署到linux下
- ===========华丽的分割线============
- 学习 对程氏舞曲CMS3.0的代码审计
- Mac下安装jdk1.6及添加java环境变量