Re: [PATCH] Documentation/git-checkout: make doc. of checkout <tree-ish> clearer
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 18, 2017, 00:26 UTC
- Message-ID
- <xmqqefwqims1.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <5EBADDE444D141918F6873BE8456E026@PhilipOakley>
"Philip Oakley" <philipoakley@iee.org> writes:
Show 5 quoted lines
> I'd guess that the misunderstanding is that you maybe thought that the > whole directory would be reset to it's old state and the files b and c > deleted, rather than just the named files present in that old commit > being extracted. If we'd created and added a file d just before the > checkout, what should have happened to d, and why?
It probably is a bit unfair to call it "misunderstanding". I've had this entry in the "Leftover Bits" list for quite some time:
git checkout $commit -- somedir may want to remove somedir/file that
is not in $commit but is in the original index. Anybody who wants to
do this needs to consider ramifications and devise transition plans.
Cf. $gmane/234935In the thread, this message:
https://public-inbox.org/git/xmqqeh8nxltc.fsf@gitster.dls.corp.google.com/
may be a good summary.