本地Git存储库的Git Archive

Mri*_*lla 3 unix linux git

我在服务器上有一个Git存储库,在同一台服务器上我有一个需要执行git archive存储库的脚本.

这是我的示例git archive命令,适用于远程Git存储库:

sudo git archive --remote=ssh://uname@dev.example.com/var/repo/myrepo.git --format=tar --output=src.tar development
Run Code Online (Sandbox Code Playgroud)

我需要做什么/更改以在同一服务器上执行上述命令,以便我不需要放置所有SSH的东西?由于该命令与存储库在同一台机器上运行,因此我可以直接访问Git目录.

谢谢

Pet*_*lka 9

使用

cd .../yourcode
sudo git archive --format=tar --output=src.tar development
Run Code Online (Sandbox Code Playgroud)

(可能没必要sudo)