关于无法取消链接 git 对象的 git 警告。我该如何解决?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22827676/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git warnings about unable to unlink git objects. How do I resolve this?
提问by Kim Stacks
When I do a git commit I see the following
当我执行 git commit 时,我看到以下内容
>$ git commit -a
warning: unable to unlink .git/objects/63/tmp_obj_kK6IC9: Invalid argument
warning: unable to unlink .git/objects/2c/tmp_obj_SFNGla: Invalid argument
I can still perform git commit. However, I want to know how to get rid of the warnings.
我仍然可以执行 git commit。但是,我想知道如何摆脱警告。
回答by Learn OpenGL ES
I had a similar problem on OS X whenever trying to run "git repack" or "git gc", and I finally solved it after coming across this page: http://hints.macworld.com/article.php?story=20010610132749532
每当尝试运行“git repack”或“git gc”时,我在 OS X 上都遇到了类似的问题,我在浏览此页面后终于解决了它:http: //hints.macworld.com/article.php?story=20010610132749532
The fix is to open a terminal, go to your git repo, cd into the .git folder, and then type chflags -R nouchg *
. If that was the issue, then after that, your git commands will work as normal.
解决方法是打开一个终端,转到您的 git 存储库,将 cd 放入 .git 文件夹,然后输入chflags -R nouchg *
. 如果那是问题所在,那么在那之后,您的 git 命令将正常工作。
回答by Selvin11
only delete ./git/gc.log
file .
只删除./git/gc.log
文件。
回答by Tim Bq
回答by Frawel
Make sure nothing is running and try to checkout a new branch, if can't try git checkout -f master, then the warning won't appear again.
确保没有任何东西在运行并尝试签出一个新分支,如果不能尝试 git checkout -f master,那么警告将不会再次出现。