xargs: git : Bad file number

纵然是瞬间 提交于 2019-12-05 17:57:35

Apart from getting the error on ssh, which you've already ruled out, it could also be that git archive can handle a limited number of argument on the command line.

You are already (suspiciously) limiting the total running length of the arguments with -s, and you indicated your command is working for some commits but not the others. You could investigate the difference further by setting GIT_TRACE=1.

Generally it is common to limit the number of arguments with xargs -n in addition to -s but beware as this will execute the command passed to xargs multiple times, when the number of arguments exceeds the -n threshold, and git archive doesn’t support appending to an archive. You will have to call a script instead, that can increment a running number for the zip archive suffix, rotate the zip filenames in some acceptable fashion, or explicitly merge the output zip files into a master zip file.

And if you are running on cygwin, EBADF can also imply that the permission to one of the files to be archived was denied by the underlying OS.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!