Search code examples
gitsvngithooksdcommit

how can I create an archive before git svn dcommit?


I'm trying to create a zip archive of my project when I push to the svn server. My old setup would use a post-receive hook on the remote git repo to do this. However, I'm now using svn and I don't own the svn server so I can't put anything over there. I've set up the following pre-push hook but this isn't running on git svn dcommit:

$cat .git/hooks/pre-push
#!/bin/sh
git archive -o foo_bar.zip --prefix foo_bar/ master

Any ideas on which hook I could use?

Thanks!


Solution

  • Since there is no such hook, how about creating an alias instead?

    dcm = "!f(){ git archive -o foo_bar.zip --prefix foo_bar/ master; git svn dcommit; }; f"