Re: using git-push to backup repo...strange behavior
- From
- david@lang.hm <david@lang.hm>
- Date
- May 30, 2008, 13:15 UTC
- Message-ID
- <alpine.DEB.1.10.0805300611230.4014@asgard.lang.hm>
- In-Reply-To
- <3a6159d2-e1ff-4aa8-bfeb-806af2bc82c8@8g2000hse.googlegroups.com>
On Fri, 30 May 2008, davetron5000 wrote:
Show 5 quoted lines
> 3. On the remote side, I can find no way to update the working dir > with the changes other than git reset --hard. Do I even need to do > this? I'd like to be able to for automated builds/tests someday. > 4. I made post-update executable, but it never runs (it echos a > message to a file)
I just went though this.
in the remote repo I make .git/hooks/post-receive executable, then edited it and made the script that it optionally calls excecutable, and uncommented it.
I then added git checkout -f and ran into a problem that was answered this morning by Johan Herland so the final script is
#!/bin/sh
if [ "$GIT_DIR" = "." ]; then
GIT_DIR=`pwd`
fi/usr/share/doc/git-core/contrib/hooks/post-receive-email cd .. /usr/bin/git checkout -f
David Lang