Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Archive of local Git repository

Tags:

git

linux

unix

I have a Git repository on a server and on the same server I have a script which needs to do a git archive of the repository.

Here's my sample git archive command which works well for remote Git repositories:

sudo git archive --remote=ssh://[email protected]/var/repo/myrepo.git --format=tar --output=src.tar development

What would I need to do/change to execute the aforementioned command on the same server so that I don't need to put all the SSH stuff? Since the command is running on the same machine as the repository, can I get away with directly accessing the Git directory.

Thanks

like image 842
Mridang Agarwalla Avatar asked Dec 17 '22 10:12

Mridang Agarwalla


1 Answers

Use

cd .../yourcode
sudo git archive --format=tar --output=src.tar development

(it is probably unnecessary to sudo)

like image 155
Petr Kozelka Avatar answered Dec 19 '22 08:12

Petr Kozelka