Git相关错误总结

http://blog.csdn.net/pipisorry/article/details/46958699

git中输入ls命令中文乱码问题

在 Git Bash 中输入 ls 命令,为了正常显示中文文件名,只需要在git安装目录下的文件etc\git-completion.bash中添加一行

alias ls='ls --show-control-chars --color=auto'

[解决git中文乱码问题]

皮皮Blog



git push 时报错 warning: push.default is unset

'matching'参数是 Git 1.x 的默认行为,其意是如果你执行 git push 但没有指定分支,它将 push 所有你本地的分支到远程仓库中对应匹配的分支。而 Git 2.x 默认的是 simple,意味着执行 git push 没有指定分支时,只有当前分支会被 push 到你使用 git pull 获取的代码。

根据提示,修改git push的行为:git config --global push.default matching。再次执行git push 得到解决。

git push比较大的文件的时候出现错误

error: RPC failed; result=22, HTTP code = 411
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date
这样的话首先改一下git的传输字节限制
git config http.postBuffer 524288000


然后这时候在传输或许会出现另一个错误
error: RPC failed; result=22, HTTP code = 413
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date
这两个错误看上去相似,一个是411,一个是413
下面这个错误添加一下密钥就可以了
首先key-keygen 生成密钥,然后把生成的密钥复制到git中自己的账号下的相应位置

git push ssh://192.168.64.250/eccp.git branch

git pull错误

甲修改了文件A并且push到了git server上,这时乙也在修改文件A,他想看一下甲修改了什么,于是从git server上pull下来,但是会遇到这样的提示:
error: Your local changes to the following files would be overwritten by merge:
文件A Please, commit your changes or stash them before you can merge.
这里乙可以commit本地文件修改再pull
可是乙不想把他未完成的修改commit,这个时候就可以先把文件A暂存起来,不commit,再pull

Error pulling origin: error: Your local changes to the following files would be overwritten by merge

git stash
git pull
git stash pop

然后可以使用git diff -w +文件名 来确认代码自动合并的情况。

[Git高级教程:git stash]

[关于git pull的问题,如何在不commit的前提下pull回来?]

[git pull更新错误解决办法 ]

[Git branch tip is behind it's remote counterpart and is preventing a 'push']

[Error pulling origin: error: The following untracked working tree files would be overwritten by...]

皮皮Blog


错误"pathspec 'branch' did not match any file(s) known to git."

git checkout master
git pull
git checkout new_branch

from:http://blog.csdn.net/pipisorry/article/details/46958699

ref:


你可能感兴趣的:(git,错误)