无法从远程 git 服务器提取单个文件
Not able to extract single file from remote git server
我问这个问题是因为我已经尝试了论坛中发布的每一个答案,但 none 对我有用。
我尝试了以下答案从远程 Git 存储库下载单个文件 "testfile.txt" 但 none 有效:
命令 1
git archive --remote=git://10.10.10.5/project.git HEAD testfile
出现以下错误:
errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)
命令 2
git archive --remote=ssh://10.10.10.5/project.git HEAD testfile
错误:提示输入我输入的 ssh 密钥密码,但随后提示我输入 root 密码,但该密码不存在。
Enter passphrase for key '/root/.ssh/id_rsa':
root@10.10.10.5's password:
Permission denied, please try again.
所以在这个阶段我想知道我做错了什么。任何帮助将不胜感激。
注:
我以 root 身份从我的本地服务器连接并访问 git 服务器,该服务器有一个 git 用户帐号
更新
我对其中一个命令做了如下修改:
git archive --remote=ssh://git@10.10.10.5/home/git/project.git HEAD local1.json
这会提示输入 ssh 密钥,然后我得到关注但找不到文件
Enter passphrase for key '/root/.ssh/id_rsa':
pax_global_header0000666000000000000000000000006412603247310088520gustar00rootroot0000000000000052 comment=e5c6e52614cccd39797bc17e7d11c4d2f7893b18
local1.json000066400000000000000000000000131260276633100131240ustar00rootroot00000000000000V2 updated
Creates an archive of the specified format containing the tree structure for the named tree, and writes it out to the standard output.
和
--format=<fmt>
Format of the resulting archive: tar or zip. If this option is not given, and the output file is specified, the format is inferred from the filename if possible (e.g. writing to "foo.zip" makes the output to be in the zip format). Otherwise the output format is tar`
所以您想执行以下操作:
git archive --remote=ssh://git@10.10.10.5/home/git/project.git HEAD local1.json > archived_file.tar
我问这个问题是因为我已经尝试了论坛中发布的每一个答案,但 none 对我有用。
我尝试了以下答案从远程 Git 存储库下载单个文件 "testfile.txt" 但 none 有效:
命令 1
git archive --remote=git://10.10.10.5/project.git HEAD testfile
出现以下错误:
errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)
命令 2
git archive --remote=ssh://10.10.10.5/project.git HEAD testfile
错误:提示输入我输入的 ssh 密钥密码,但随后提示我输入 root 密码,但该密码不存在。
Enter passphrase for key '/root/.ssh/id_rsa':
root@10.10.10.5's password:
Permission denied, please try again.
所以在这个阶段我想知道我做错了什么。任何帮助将不胜感激。
注:
我以 root 身份从我的本地服务器连接并访问 git 服务器,该服务器有一个 git 用户帐号
更新
我对其中一个命令做了如下修改:
git archive --remote=ssh://git@10.10.10.5/home/git/project.git HEAD local1.json
这会提示输入 ssh 密钥,然后我得到关注但找不到文件
Enter passphrase for key '/root/.ssh/id_rsa':
pax_global_header0000666000000000000000000000006412603247310088520gustar00rootroot0000000000000052 comment=e5c6e52614cccd39797bc17e7d11c4d2f7893b18
local1.json000066400000000000000000000000131260276633100131240ustar00rootroot00000000000000V2 updated
Creates an archive of the specified format containing the tree structure for the named tree, and writes it out to the standard output.
和
--format=<fmt>
Format of the resulting archive: tar or zip. If this option is not given, and the output file is specified, the format is inferred from the filename if possible (e.g. writing to "foo.zip" makes the output to be in the zip format). Otherwise the output format is tar`
所以您想执行以下操作:
git archive --remote=ssh://git@10.10.10.5/home/git/project.git HEAD local1.json > archived_file.tar