path: root/Documentation/git-replace.txt
diff options
authorChristian Couder <>2009-10-12 20:30:32 (GMT)
committerJunio C Hamano <>2009-10-13 08:07:29 (GMT)
commitb0fa7ab51b29d34579d8f6bb4443dfbcb8278c7a (patch)
tree3eba2d188f34ca22c2a789f1c4e657139662fcc5 /Documentation/git-replace.txt
parent78d553b7d7b269bb22ebd8b1198657c37484a3a0 (diff)
git: add --no-replace-objects option to disable replacing
Commit dae556b (environment: add global variable to disable replacement) adds a variable to enable/disable replacement, and it is enabled by default for most commands. So there is no way to disable it for some commands, which is annoying when we want to get information about a commit that has been replaced. For example: $ git cat-file -p N would output information about the replacement commit if commit N is replaced. With the "--no-replace-objects" option that this patch adds it is possible to get information about the original commit using: $ git --no-replace-objects cat-file -p N While at it, let's add some documentation about this new option in the "git replace" man page too. Signed-off-by: Christian Couder <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'Documentation/git-replace.txt')
1 files changed, 21 insertions, 0 deletions
diff --git a/Documentation/git-replace.txt b/Documentation/git-replace.txt
index 915cb77..8adc1ef 100644
--- a/Documentation/git-replace.txt
+++ b/Documentation/git-replace.txt
@@ -23,6 +23,26 @@ replacement object.
Unless `-f` is given, the replace reference must not yet exist in
`.git/refs/replace/` directory.
+Replace references will be used by default by all git commands except
+those doing reachability traversal (prune, pack transfer and fsck).
+It is possible to disable use of replacement refs for any command
+using the --no-replace-objects option just after "git".
+For example if commit "foo" has been replaced by commit "bar":
+$ git --no-replace-object cat-file commit foo
+show information about commit "foo", while:
+$ git cat-file commit foo
+show information about commit "bar".
@@ -54,6 +74,7 @@ SEE ALSO