From: Junio C Hamano Date: Sun, 18 Apr 2010 23:11:21 GMT Subject: Re: [PATCH v2 2/3] stash: Don't overwrite files that have gone from the index Message-ID: <7vpr1wtkyu.fsf@alter.siamese.dyndns.org> In-Reply-To: <20100418182805.GB29329@hashpling.org> Charles Bailey writes: > To be complete, any work tree file which differs from HEAD needs to be > saved, regardless of whether it still appears in the index or not. Sounds quite sane. > - git add -u && > + git diff --name-only -z HEAD | git update-index -z --add --remove --stdin && Paths that exist in HEAD but not in the index will be caught with this; what about paths that do not exist in HEAD but is in the index---they will be kept in the index so they are fine as well. Good. Thanks.