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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:52:50

Neal Kreitzinger [off-list ref] 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.

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

From: Neal Kreitzinger <hidden>
Date: 2016-06-15 22:52:50

On 1/20/2012 6:16 PM, Junio C Hamano wrote:
Neal Kreitzinger[off-list ref]  writes:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help