From: Junio C Hamano Date: Tue, 23 Aug 2005 21:54:30 GMT Subject: Re: [RFC] Removing deleted files after checkout Message-ID: <7vvf1wnwtl.fsf@assigned-by-dhcp.cox.net> In-Reply-To: Daniel Barkalow writes: >> > If you don't use -f, git-checkout-script removes deleted files. Using -f >> > tells it to ignore the old index, which means that it can't tell the >> > difference between removed files and files that weren't tracked at all. Yes and no. "git checkout" assumes that the index file and the working tree somewhat resembles what is in .git/HEAD commit. Since push operation updates .git/HEAD commit without touching the index file, that assumption does not hold. The update hook gets old commit name and new commit name, so you should be able to do (untested): git-read-tree -m -u $old_commit $new_commit there, of course after making sure that you had old_commit (the first time push happens to a new ref you would not have that one).