在 master 分支上面有 N 个 commit ,现在要把这些 commit 合并为一个,我就用git rebase -i 23364d 把这些 commit 合并了,然后再往服务器 push ,结果就报错
Counting objects: 2, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 665 bytes | 0 bytes/s, done.
Total 2 (delta 0), reused 1 (delta 0)
remote: error: insufficient permission for adding an object to repository database objects
remote: fatal: failed to write object 33a66d58ac89fb134a8fcaeaf671b233de675924
error: unpack failed: unpack-objects abnormal exit
To http://192.168.0.111:8080/release.git
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'http://192.168.0.111:8080/release.git'
然后我就照着 so 上面有人的答案git repack master 之后再 push ,还是一样的错误,没办法 push 到服务器,这个怎么解决?
1
yuanji 2015 年 11 月 12 日
git push -f 呢?
|
2
daniellu 2015 年 11 月 12 日
最好不要-f 强推就算成功了 可能代码就有问题了
git status 一下看看 |
4
daniellu 2015 年 11 月 12 日
没有其它的信息吗?@oska874
|
5
oska874 OP @daniellu 没了, clean 。问题得是“ remote: fatal: failed to write object 33a66d58ac89fb134a8fcaeaf671b233de675924 ” 服务器上没有 33a66d58ac89fb134a8fcaeaf671b233de675924 这个提交。
|
6
mok502 2015 年 11 月 12 日 remote: error: insufficient permission for adding an object to repository database objects
Git 服務器權限問題。 |
9
luoluoluo 2015 年 11 月 12 日
似乎我 13 年的时候遇到过,好久没用 git 了,从我经久失修的博客里貌似有办法
http://lf2013.github.io/tools/skill/2013/08/08/gitnote/ 博客 N 就没管了,乱码、排版什么的请无视,重在解决问题 |
10
bingwenshi 2015 年 11 月 12 日
你没有理解 rebase 的原理, rebase 本身就是调整 branch 上的 commits ,所以肯定是要 push -f 的
|
11
yangg 2015 年 11 月 12 日
push -f , gitlab 用户权限那里要有“+”号。
+rw 类似这样 |
12
oska874 OP |