Subject: Re: post-receive for web deployment

From: Johannes Sixt <[email-masked]>
Date: Mon, 19 Dec 2011 07:55:20 +0100

Am 12/19/2011 3:42, schrieb Stephen Major:
> checking the remote server files 4 5 6 are still found in:
> /home/user/domains/domain.com/public_html/live
> 
> Why is this happening?

Before you check out the files, you must ensure that the index matches the
content in the GIT_WORK_TREE that you populate by git checkout.

You first push a tree that removes 4 5 6 while the index you happen to
have still has those files recorded, the files are removed. Your second
push does not have these files anymore, but the index does not record the
files anymore, either; therefore, git does not act on the files 4 5 6 that
happen to live in the other worktree.

Perhaps you should maintain separate index files and set GIT_INDEX_FILE
accordingly before git checkout.

-- Hannes