1、git 错误解决:fatal: ‘git status –porcelain’ failed in submodule android_rk/system/core
转载自:http://blog.csdn.net/may680/article/details/40672291
在进行Git操作时遇到一个比较怪异的事件:
从其他源代码中拷贝了一个目录到自己代码中,对这个目录进行了文件增加操作,并使用 git add 加入一些文件之后,运行 git status 会出现硬盘灯长亮,系统繁忙,反复提示错误信息:
“fatal: ‘git status –porcelain’ failed in submodule android_rk/system/core”
删除这个目录后,问题消失;再次增加这个目录,又会出现这个现象。
后来发现在 android_rk/system/core 目录下有隐藏的目录 .git 和文件 .gitignore ,这是 git 专用的目录,拷贝的时候带过来的。
删除这两个,问题就解决了。
以后要注意,git管理的目录中不能再带.git目录。
2、git 错误 fatal: Not a valid object name: ‘master’.
解答:
http://stackoverflow.com/questions/9162271/fatal-not-a-valid-object-name-master
Git init a folder
此时并没有创建一个master分支。除非你commit过,否则Git不会创建一个master分支。
在你的目录中添加一个或多个文件 ,git add这些文件,准备提交。 git commit 创建你的初始提交和master分支。
3、git repository fatal: Could not read from remote repository.
在用as的时候出现的问题,之后尝试在gitbash里面push代码,也没有成功。
Permission denied (publickey).
fatal: Could not read from remote repository.
查了资料,有可能是ssh key过期,重新生成,并添加之后,问题解决。
ssh-keygen -t rsa
下面链接提供了2种方式,第二种我没有尝试,可以试试。
http://stackoverflow.com/questions/24688700/android-studio-push-failed-fatal-could-not-read-from-remote-repository