path: root/Documentation/git-update-index.txt
diff options
authorPetr Baudis <>2008-07-18 14:11:07 (GMT)
committerJunio C Hamano <>2008-07-19 18:17:43 (GMT)
commit6259ac6628477aa5ebde9bd9e8daaeecca2a74ae (patch)
tree3d0480c01add01bf5fe8be392ec8a52a2eb075c8 /Documentation/git-update-index.txt
parentc47f10246ac6413ac6902bd70e45492174fac873 (diff)
Documentation: How to ignore local changes in tracked files
This patch explains more carefully that `.gitignore` concerns only untracked files and refers the reader to git update-index --assume-unchanged in the need of ignoring uncommitted changes in already tracked files. The description of this option is lifted to a more "porcelainish" level and explains the caveats of this usecase. Whether feasible or not, I believe adding this functionality to the porcelain is out of the scope of this patch. (And I personally think that referring to the plumbing in the case of such a special usage is fine.) This is currently probably one of the top FAQs at #git and the --assume-unchanged switch is not widely known; gitignore(5) is the first place where people are likely to look for it. Signed-off-by: Petr Baudis <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/git-update-index.txt')
1 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index a91fd21..6b930bc 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -88,6 +88,16 @@ OPTIONS
sometimes helpful when working with a big project on a
filesystem that has very slow lstat(2) system call
(e.g. cifs).
+This option can be also used as a coarse file-level mechanism
+to ignore uncommitted changes in tracked files (akin to what
+`.gitignore` does for untracked files).
+You should remember that an explicit 'git add' operation will
+still cause the file to be refreshed from the working tree.
+Git will fail (gracefully) in case it needs to modify this file
+in the index e.g. when merging in a commit;
+thus, in case the assumed-untracked file is changed upstream,
+you will need to handle the situation manually.