git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: using git-push to backup repo...strange behavior

From
Ddavid@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
Previous: Teemu Likonen
Message 3 of 3 in “using git-push to backup repo...strange behavior”
  1. davetron5000May 30, 2008
  2. hooks/post-update does not runTeemu Likonen, May 30, 2008
  3. david@lang.hmMay 30, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.