// 错误:
error occurred during unpacking on the remote…unpack-objects abnormal exit
原因:a.GIT服务器端对应GIT仓库目录的访问权限问题,在服务端运行:chown -R git:git /D002/workspacejava/ymcode
// 错误:
You can set ‘receive.denyCurrentBranch’ configuration variable to或branch is currently checked out error: refusing to update checked out branch: refs/heads/master
原因:不设置拒绝当前分支的参数为忽略的话,当前分支就提交不上去
解决:在服务端的的项目Git仓库中的.git/config中添加(该配置只能这样设置,若设置为全局变量会无效)
[receive]
denyCurrentBranch = ignore
// 错误:
fatal: ‘…/.git’ does not appear to be a git repository
fatal: The remote end hung up unexpectedly
原因:a.git路径写错了正确的如:/D002/workspacejava/ymcode/.git
b.提交缓冲区大小不够,解决:git config --global http.postBuffer 524288000
c.无权限访问,解决:重新授予用户组为git中的git用户的权限:chown -R git:git /D002/workspacejava/ymcode
// 错误:
error: insufficient permission for adding an object to repository database ./objects
原因:当有新的git文件提交后会写.git/objects下的缓存文件,这时权限会被更新(如果用的是git用户的话),我们只需要修改为组权限即可
修改:chown -R git:git /D002/workspacejava/ymcode
// 错误:在eclipse中提交不了,之前崩溃过
解决:直接到项目git所在根目录.git目录下将index.lock删除就可以了,注意:删除前index.lock是个空文件,这个文件是阻止git提交的
// push到服务器失败,出现git-receive-pack错误
原因:用户名密码错误,有可能eclipse保存了其他项目的用户名和密码,这时需要先清空之前保存的用户名密码,然后再push
解决:可以尝试window->preferences中搜索->secure storage找到content项进行删除,也可以删除C:\Users\ice.eclipse\org.eclipse.equinox.security\secure_storage然后重启eclipse