如果一个git仓库有很多分支,这些分支里的内容大都相似,但是有时候提交相同的代码需要合并到不同的分支里,就需要git cherry-pick。
在执行git cherry-pick后,再执行git push时,有时候会有权限不足的情况:
yonghe@njpateo-210:core$ git push origin HEAD:refs/for/a1001ef-m
Counting objects: 1, done.
Writing objects: 100% (1/1), 258 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
error: unpack failed: error Missing tree cc671139de53af24e0b2f02356f3c09779b299f3
fatal: Unpack error, check server log
To ssh://yonghe@10.10.96.214:29418/projects/DLS-Auto-F6/platform/system/core
! [remote rejected] HEAD -> refs/for/a1001ef-m (n/a (unpacker error))
error: 无法推送一些引用到 'ssh://yonghe@10.10.96.214:29418/projects/DLS-Auto-F6/platform/system/core'
可以通过以下方式尝试执行
git push --no-thin origin HEAD:refs/for/a1001ef-m
网络上的一些描述:
有时候我们执行 git push 将一个 new branch 推送到远程仓库的时候,会被远程仓库阻止。
可能是我们没有相应的权限吧。然而,我在 git push 的时候加上 --no-thin 参数,就可以将其推送上去了
git push –no-thin 实际上禁止了“thin pack transfer”优化。
-
--thin
--no-thin
-
These options are passed to git-send-pack(1). A thin transfer significantly reduces the amount of sent data when the sender and receiver share many of the same objects in common. The default is --thin.
本文介绍了解决在使用Git过程中遇到的推送权限不足的问题。通过使用`git push --no-thin`命令,可以成功地将分支推送到远程仓库,避免因权限问题导致的推送失败。

1525

被折叠的 条评论
为什么被折叠?



