1GIT-REPLACE(1) Git Manual GIT-REPLACE(1)
2
3
4
6 git-replace - Create, list, delete refs to replace objects
7
9 git replace [-f] <object> <replacement>
10 git replace -d <object>...
11 git replace -l [<pattern>]
12
13
15 Adds a replace reference in refs/replace/ namespace.
16
17 The name of the replace reference is the SHA-1 of the object that is
18 replaced. The content of the replace reference is the SHA-1 of the
19 replacement object.
20
21 Unless -f is given, the replace reference must not yet exist.
22
23 Replacement references will be used by default by all Git commands
24 except those doing reachability traversal (prune, pack transfer and
25 fsck).
26
27 It is possible to disable use of replacement references for any command
28 using the --no-replace-objects option just after git.
29
30 For example if commit foo has been replaced by commit bar:
31
32 $ git --no-replace-objects cat-file commit foo
33
34
35 shows information about commit foo, while:
36
37 $ git cat-file commit foo
38
39
40 shows information about commit bar.
41
42 The GIT_NO_REPLACE_OBJECTS environment variable can be set to achieve
43 the same effect as the --no-replace-objects option.
44
46 -f
47 If an existing replace ref for the same object exists, it will be
48 overwritten (instead of failing).
49
50 -d
51 Delete existing replace refs for the given objects.
52
53 -l <pattern>
54 List replace refs for objects that match the given pattern (or all
55 if no pattern is given). Typing "git replace" without arguments,
56 also lists all replace refs.
57
59 Comparing blobs or trees that have been replaced with those that
60 replace them will not work properly. And using git reset --hard to go
61 back to a replaced commit will move the branch to the replacement
62 commit instead of the replaced commit.
63
64 There may be other problems when using git rev-list related to pending
65 objects. And of course things may break if an object of one type is
66 replaced by an object of another type (for example a blob replaced by a
67 commit).
68
70 git-tag(1) git-branch(1) git(1)
71
73 Part of the git(1) suite
74
75
76
77Git 1.8.3.1 11/19/2018 GIT-REPLACE(1)