[英]Why am I getting “remote: fatal: path not found: HEAD” error when I run git archive?
I am trying to extract a single file from my git repo like so ... 我试图像这样从我的git repo中提取一个文件...
$ git archive --remote=red-git:/opt/red-git/RED-puppet.git development HEAD:usr/local/scripts/apply.sh | tar -xvf -
... but it doesn't work. ...但是它不起作用。 I get this error message.
我收到此错误消息。
remote: fatal: path not found: HEAD:usr/local/scripts/apply.sh
remote: git upload-archive: archiver died with error
fatal: sent error to the client: git upload-archive: archiver died with error
tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors
I know there are a ton of questions and answer about how to extract a single file from git, but none of them have been able to explain to me why am I getting the error: 我知道有很多关于如何从git提取单个文件的问题和答案,但是没有一个能够向我解释为什么我得到错误:
remote: fatal: path not found: HEAD:usr/local/scripts/apply.sh
I know the shell script is there because I can do this ... 我知道shell脚本在那里,因为我可以做到这一点...
$ git archive --remote=red-git:/opt/red-git/RED-puppet.git development | tar -xvf - | grep apply.sh
...
usr/local/scripts/apply.sh
After banging my HEAD
against the wall and much trail and error I came upon this command-line that does the trick: 在将我的
HEAD
撞到墙上并且发生了很多错误之后,我遇到了执行此操作的命令行:
git archive --remote=red-git:/opt/red-git/RED-puppet.git development usr/local/scripts/apply.sh | tar -xvf -
No HEAD:
. 没有
HEAD:
。 Good I wasn't really sure what that meant anyways. 很好,我真的不确定那意味着什么。 :)
:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.