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

Re: post-update to stash after push to non-bare current branch

From
NKNeal Kreitzinger <nkreitzinger@gmail.com>
Date
Jan 21, 2012, 00:35 UTC
Message-ID
<4F1A0849.8050205@gmail.com>
In-Reply-To
<7vr4ytdi54.fsf@alter.siamese.dyndns.org>
On 1/20/2012 6:16 PM, Junio C Hamano wrote:
Show 12 quoted lines
> Neal Kreitzinger<nkreitzinger@gmail.com>  writes:
>
>> To get this to work I had to learn more about shell scripting and export
>> the GIT_WORK_TREE git environment variable.
>>
>> (post-update hook):
>> export GIT_WORK_TREE=/home/neal/FSNMSTHTML
>> git checkout -f HEAD
>
>
> Hmm, I thought "cd ..&&  git checkout -f HEAD" (or "git reset --hard")
> would have worked.

Ok, I just tried that for the first time and it complained "not a git repository: '.'" because it looks like that caused GIT_DIR to no longer point to WORKTREE/.git but instead to WORKTREE/ because GIT_DIR is set to '.' in the post-update script's environment as indicated in this thread: http://stackoverflow.com/questions/6635018/reuse-git-work-tree-in-post-receive-hook-to-rm-a-few-files

v/r, neal

Previous: Junio C Hamano
Message 10 of 10 in “post-update to stash after push to non-bare current branch”
  1. Neal KreitzingerJan 18, 2012
  2. Neal KreitzingerJan 18, 2012
  3. Neal KreitzingerJan 18, 2012
  4. Junio C HamanoJan 18, 2012
  5. Neal KreitzingerJan 19, 2012
  6. Junio C HamanoJan 19, 2012
  7. Neal KreitzingerJan 19, 2012
  8. Neal KreitzingerJan 21, 2012
  9. Junio C HamanoJan 21, 2012
  10. Neal KreitzingerJan 21, 2012

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.