read-tree: document --exclude-per-directory
authorJunio C Hamano <junkio@cox.net>
Wed, 6 Dec 2006 07:44:23 +0000 (23:44 -0800)
committerJunio C Hamano <junkio@cox.net>
Wed, 6 Dec 2006 07:44:23 +0000 (23:44 -0800)
This documents the new option to read-tree that is used for the
improved "branch switching" code.

Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/git-read-tree.txt
builtin-read-tree.c
index 11bd9c0adc5517ef1aadc76abdb8dfb0827c27b0..0ff2890c7fb76155e08eaf9e361bf1eb6cf50f25 100644 (file)
@@ -8,7 +8,7 @@ git-read-tree - Reads tree information into the index
 
 SYNOPSIS
 --------
-'git-read-tree' (<tree-ish> | [[-m [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] <tree-ish1> [<tree-ish2> [<tree-ish3>]])
+'git-read-tree' (<tree-ish> | [[-m [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] [--exclude-per-directory=<gitignore>] <tree-ish1> [<tree-ish2> [<tree-ish3>]])
 
 
 DESCRIPTION
@@ -71,6 +71,20 @@ OPTIONS
        directory.  Note that the `<prefix>/` value must end
        with a slash.
 
+--exclude-per-directory=<gitignore>::
+       When running the command with `-u` and `-m` options, the
+       merge result may need to overwrite paths that are not
+       tracked in the current branch.  The command usually
+       refuses to proceed with the merge to avoid losing such a
+       path.  However this safety valve sometimes gets in the
+       way.  For example, it often happens that the other
+       branch added a file that used to be a generated file in
+       your branch, and the safety valve triggers when you try
+       to switch to that branch after you ran `make` but before
+       running `make clean` to remove the generated file.  This
+       option tells the command to read per-directory exclude
+       file (usually '.gitignore') and allows such an untracked
+       but explicitly ignored file to be overwritten.
 
 <tree-ish#>::
        The id of the tree object(s) to be read/merged.
index 3f6cae36ce9b730bf6b76f3f1fedd006f356854b..8ba436dbace7ec25ec5768a5c6c84f3202f92159 100644 (file)
@@ -85,7 +85,7 @@ static void prime_cache_tree(void)
 
 }
 
-static const char read_tree_usage[] = "git-read-tree (<sha> | [[-m [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] <sha1> [<sha2> [<sha3>]])";
+static const char read_tree_usage[] = "git-read-tree (<sha> | [[-m [--aggressive] | --reset | --prefix=<prefix>] [-u | -i]] [--exclude-per-directory=<gitignore>] <sha1> [<sha2> [<sha3>]])";
 
 static struct lock_file lock_file;