Git填坑记

git clone error

问题呈现

问题呈现

1
2
3
4
5
6
7
8
9
10
Administrator@HuangDayu MINGW64 /e/GitHub (master)
$ git clone https://github.com/HuangDayu/huangdayu.github.io.git
Cloning into 'huangdayu.github.io'...
remote: Enumerating objects: 278, done.
remote: Counting objects: 100% (278/278), done.
remote: Compressing objects: 100% (217/217), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

问题原因

克隆的资源文件过大,git的缓存不够用!

解决办法

将缓存改大即可

1
git config --global http.postBuffer 524288000

git pull error

问题呈现

1
2
3
4
5
6
7
Administrator@HuangDayu MINGW64 /e/GitHub/huangdayu.github.io (master)
$ git pull
ssh: Could not resolve hostname github: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

问题原因

hostname 绑定错误

查看hostname

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Administrator@HuangDayu MINGW64 /e/GitHub/huangdayu.github.io (master)
$ cat /c/Users/Administrator/.ssh/config
# Default github user(first@mail.com)

Host github.com
HostName github.com
User git
IdentityFile C:/Users/Administrator/.ssh/github_rsa

Host gitee.com
HostName gitee.com
User git
IdentityFile C:/Users/Administrator/.ssh/gitee_rsa

解决办法

重新绑定

1
2
3
4
5
Administrator@HuangDayu MINGW64 /e/GitHub/huangdayu.github.io (master)
$ git remote rm origin

Administrator@HuangDayu MINGW64 /e/GitHub/huangdayu.github.io (master)
$ git remote add origin git@github.com:HuangDayu/huangdayu.github.io.git