I am trying to make a simple backup script for my remotely hosted git repos. In the script I have a few lines that currently look like this:
git clone git@server:repo.git $DEST
tar czvf repo.tgz $DEST
rm -rf $DEST
Is there a way to make this all happen in one line? Can I pipe the git clone into the tar command? I don't need the cloned directory, I just want the compressed archive of it.
I've tried some experiments but can't seem to figure out the syntax.
--remote
option togit archive
requires that the server has an option enabled to allow it. By default it is not enabled. – Hurricane