1GIT-REPLACE(1)                    Git Manual                    GIT-REPLACE(1)
2
3
4

NAME

6       git-replace - Create, list, delete refs to replace objects
7

SYNOPSIS

9       git replace [-f] <object> <replacement>
10       git replace -d <object>...
11       git replace -l [<pattern>]
12
13

DESCRIPTION

15       Adds a replace reference in .git/refs/replace/
16
17       The name of the replace reference is the SHA1 of the object that is
18       replaced. The content of the replace reference is the SHA1 of the
19       replacement object.
20
21       Unless -f is given, the replace reference must not yet exist in
22       .git/refs/replace/ directory.
23
24       Replacement references will be used by default by all git commands
25       except those doing reachability traversal (prune, pack transfer and
26       fsck).
27
28       It is possible to disable use of replacement references for any command
29       using the --no-replace-objects option just after git.
30
31       For example if commit foo has been replaced by commit bar:
32
33           $ git --no-replace-objects cat-file commit foo
34
35
36       shows information about commit foo, while:
37
38           $ git cat-file commit foo
39
40
41       shows information about commit bar.
42
43       The GIT_NO_REPLACE_OBJECTS environment variable can be set to achieve
44       the same effect as the --no-replace-objects option.
45

OPTIONS

47       -f
48           If an existing replace ref for the same object exists, it will be
49           overwritten (instead of failing).
50
51       -d
52           Delete existing replace refs for the given objects.
53
54       -l <pattern>
55           List replace refs for objects that match the given pattern (or all
56           if no pattern is given). Typing "git replace" without arguments,
57           also lists all replace refs.
58

BUGS

60       Comparing blobs or trees that have been replaced with those that
61       replace them will not work properly. And using git reset --hard to go
62       back to a replaced commit will move the branch to the replacement
63       commit instead of the replaced commit.
64
65       There may be other problems when using git rev-list related to pending
66       objects. And of course things may break if an object of one type is
67       replaced by an object of another type (for example a blob replaced by a
68       commit).
69

SEE ALSO

71       git-tag(1) git-branch(1) git(1)
72

AUTHOR

74       Written by Christian Couder <chriscool@tuxfamily.org[1]> and Junio C
75       Hamano <gitster@pobox.com[2]>, based on git tag by Kristian Hogsberg
76       <krh@redhat.com[3]> and Carlos Rica <jasampler@gmail.com[4]>.
77

DOCUMENTATION

79       Documentation by Christian Couder <chriscool@tuxfamily.org[1]> and the
80       git-list <git@vger.kernel.org[5]>, based on git tag documentation.
81

GIT

83       Part of the git(1) suite
84

NOTES

86        1. chriscool@tuxfamily.org
87           mailto:chriscool@tuxfamily.org
88
89        2. gitster@pobox.com
90           mailto:gitster@pobox.com
91
92        3. krh@redhat.com
93           mailto:krh@redhat.com
94
95        4. jasampler@gmail.com
96           mailto:jasampler@gmail.com
97
98        5. git@vger.kernel.org
99           mailto:git@vger.kernel.org
100
101
102
103Git 1.7.4.4                       04/11/2011                    GIT-REPLACE(1)
Impressum