简体   繁体   English

当我运行git archive时,为什么会出现“远程:致命:找不到路径:HEAD”错误?

[英]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.

相关问题 为什么我收到那个错误? 致命:在上游源中找不到远程分支 redux-basics - why i am getting that error ? fatal: Remote branch redux-basics not found in upstream origin 为什么我收到错误“致命:'C:/ Program Files(x86)/ Git'在存储库外”当我从存储库中运行“git reset --hard~1”时? - Why am I getting error “fatal: 'C:/Program Files (x86)/Git' is outside the repository” when I run “git reset --hard ~1” from within the repository? 当我尝试注释 git 历史 Intellij 显示错误:致命:HEAD 中没有这样的路径 - When I try to annotate git history Intellij show error:fatal: no such path in HEAD 我收到错误:RPC 失败; 致命:远程端在git上意外挂断 - I am getting error: RPC failed; fatal: the remote end hung up unexpectedly on git 为什么我在运行 git filter-branch 时出现 pathspec 错误? - Why am I getting pathspec error when I run git filter-branch? 为什么在 git 工作树中查找顶级目录时会出现“fatal: not a git repository...”? - Why am I getting `fatal: not a git repository...` when looking up toplevel dir in a git worktree? 为什么在运行git reset --hard HEAD时出现“未跟踪文件”错误? - Why am I getting “Untracked files” error upon running git reset --hard HEAD? 为什么在 git 拉取或 git 克隆后出现“错误:无效路径‘\’”? - Why I am getting "error: invalid path '\'" after git pull or git clone? 为什么我在 git 推送中收到远程异常? - Why I am getting remote excpetion in git push? 当我在git命令提示符下键入“ git add”时,收到致命消息,即不是git存储库。 - I am getting fatal message i.e not a git repository, when I am typing “git add .” in git command prompt.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM