[PATCH] Added description for inverting git-update-index using --index-info

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andy Parkins
Date: Friday, October 27, 2006 - 2:03 am

I wanted to restore a single file from HEAD back to the index; Shawn Pearce
gave me the answer.  git-ls-tree piped to git-update-index --index-info.

This patch adds that answer to the git-update-index documentation.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
 Documentation/git-update-index.txt |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 41bb7e1..5adf717 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -215,6 +215,24 @@ $ git ls-files -s
 100755 8a1218a1024a212bb3db30becd860315f9f3ac52 2	frotz
 ------------
 
+One particular use of --index-info is to reverse the effect of
+"git-update-index frotz":
+
+------------
+git ls-tree HEAD frotz | git update-index --index-info
+------------
+
+This makes the index hold the file frotz from HEAD rather than from the
+working copy.  Similarly:
+
+------------
+git ls-tree -r HEAD | git update-index --index-info
+------------
+
+Will undo everything except "git add" from the index, as
+"git-ls-tree -r" lists everything in the last commit.
+
+
 
 Using "assume unchanged" bit
 ----------------------------
-- 
1.4.3.3.g5bca6

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Restore a single file in the index back to HEAD, Andy Parkins, (Thu Oct 26, 8:41 am)
Re: Restore a single file in the index back to HEAD, Alex Riesen, (Thu Oct 26, 8:42 am)
Re: Restore a single file in the index back to HEAD, Andy Parkins, (Fri Oct 27, 12:27 am)
Re: Restore a single file in the index back to HEAD, Shawn Pearce, (Fri Oct 27, 12:38 am)
Re: Restore a single file in the index back to HEAD, Andy Parkins, (Fri Oct 27, 1:01 am)
Re: Restore a single file in the index back to HEAD, Andreas Ericsson, (Fri Oct 27, 1:08 am)
Re: Restore a single file in the index back to HEAD, Shawn Pearce, (Fri Oct 27, 1:15 am)
[PATCH] Added description for inverting git-update-index u ..., Andy Parkins, (Fri Oct 27, 2:03 am)
Re: Restore a single file in the index back to HEAD, Alex Riesen, (Fri Oct 27, 2:45 am)
Re: Restore a single file in the index back to HEAD, Andreas Ericsson, (Fri Oct 27, 2:50 am)
Re: Restore a single file in the index back to HEAD, Junio C Hamano, (Fri Oct 27, 3:02 am)
Re: Restore a single file in the index back to HEAD, Luben Tuikov, (Fri Oct 27, 10:45 am)
Re: Restore a single file in the index back to HEAD, Nguyen Thai Ngoc Duy, (Wed Nov 1, 12:58 am)
Re: Restore a single file in the index back to HEAD, Junio C Hamano, (Wed Nov 1, 1:07 am)
Re: Restore a single file in the index back to HEAD, Junio C Hamano, (Wed Nov 1, 1:34 am)
Re: Restore a single file in the index back to HEAD, Andy Parkins, (Wed Nov 1, 1:39 am)
Re: Restore a single file in the index back to HEAD, Junio C Hamano, (Wed Nov 1, 1:56 am)
Re: Restore a single file in the index back to HEAD, Nguyen Thai Ngoc Duy, (Wed Nov 1, 2:09 am)
Re: Restore a single file in the index back to HEAD, Andy Parkins, (Wed Nov 1, 2:53 am)