在AndroidStudio上传项目到github出现“fatal: remote github already exists”的解决方法

来源:互联网 发布:php扩展开发教程 语法 编辑:程序博客网 时间:2024/05/16 02:47

今天把github中的一个仓库删除,准备通过AndroidStudio重新上传该项目,但是在上传的过程中出现了“fatal: remote github already exists”错误,谷歌许久终于找到解决方法。


解决方法:

关闭Android Studio,进入电脑中你要上传的那个项目的目录,开启“显示隐藏文件”的功能,就能看到隐藏的文件夹/.git  ,打开其中的config文件,删除类似于下面格式的三行:

[remote "origin"]url = https://github.com/haoge728/CloudMusic.gitfetch = +refs/heads/*:refs/remotes/origin/*

然后保存config文件。重新打开Android Studio,点击“Share project on GitHub”上传项目到github,就不会有“ project is already on GitHub ”或者“fatal: remote github already exists”的错误提示了。

阅读全文
0 0
原创粉丝点击