Git

git问题记录--非常规问题

adtxl
2023-05-11 / 0 评论 / 410 阅读 / 正在检测是否收录...

记录一些不是经常遇到的问题

1. "error: invalid path" during git clone to Windows client

在Windows上使用git clone后,遇到错误,提示一些路径无效,具体原因参考"error: invalid path" during git clone to Windows client

解决方案:
Depending on the filename, configuring Git to ignore NTFS naming may workaround the issue.使用如下命令:

git config --global core.protectNTFS false

2. git push 出现 unpack failed: error Missing tree错误

在一个分支较多的仓库提交,很容易出现这个错误

解决方案:
解决方法来自 stackoverflow.使用如下命令即可推送成功:

git push --no-thin review HEAD:refs/for/master

关键点是 --no-thin 选项. stackoverflow 上的那位答主这么解释的:

默认情况下 git push 会在向服务器推送时进行优化,以将所发送的包降低到最小. 做法是发送时忽略本地仓库和远端仓库中共有的部分. 即 git push 默认是采用 --thin 选项的.
发生本文中出现的问题,貌似是因为某个 git 对象和服务器不一致了.这时加上 --no-thin 参数,把该传的都传过去,问题就解决了.

stackoverflow 链接如下:
http://stackoverflow.com/questions/16586642/git-unpack-error-on-push-to-gerrit

0

评论 (0)

取消