git 使用过程遇到的问题集合

来源:互联网 发布:三力网络朱静 编辑:程序博客网 时间:2024/04/28 05:51

1、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分支。

2、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

0 0