git常见报错解决办法,fatal: the remote end hung up unexpectedly

问题一: 上传GIT项目报fatal: the remote end hung up unexpectedly错误
上传项目报fatal: the remote end hung up unexpectedly的错误,
应该是项目太大的原因, 要么是网络不行,要么墙的原因
解决办法:
修改提交缓存大小为500M,或者更大的数字
git config --global http.postBuffer 524288000
# some comments below report having to double the value:
git config --global http.postBuffer 1048576000
 
或者是 在克隆/创建版本库生成的 .git/config 文件中加入:
[http]
postBuffer = 524288000

问题二:git push报错:The current branch master has no upstream branch

进行 git push 操作时报错: fatal: The current branch master has no upstream branch.
原因:
没有将本地的分支与远程仓库的分支进行关联
通过 git branch 查看本地分支只有 master
通过 git branch -a 查看远程分支,有 master remotes/origin/master 两个
这时由于远程仓库太多,且分支较多。在默认情况下, git push 时一般会上传到 origin 下的 master 分支上,然而当 repository branch 过多,而又没有设置关联时,git就会产生疑问,因为它无法判断你的push目标

解决方式一

与远程仓库建立关联,运行后即可通过 git push 推送成功
使用 git push --set-upstream origin master 命令

方式二

如果已在远程github仓库中手动建过同名的本地分支也可通过另一种方法
使用 git push -u origin master 命令
 
 

猜你喜欢

转载自blog.csdn.net/mrcool2012/article/details/104769505
今日推荐