fixup tr/stash-format merge
[git/gitweb.git] / Documentation / git-replace.txt
blob8adc1ef55c620d04fc10b8d6ccb0b9c90765a753
1 git-replace(1)
2 ==============
4 NAME
5 ----
6 git-replace - Create, list, delete refs to replace objects
8 SYNOPSIS
9 --------
10 [verse]
11 'git replace' [-f] <object> <replacement>
12 'git replace' -d <object>...
13 'git replace' -l [<pattern>]
15 DESCRIPTION
16 -----------
17 Adds a 'replace' reference in `.git/refs/replace/`
19 The name of the 'replace' reference is the SHA1 of the object that is
20 replaced. The content of the replace reference is the SHA1 of the
21 replacement object.
23 Unless `-f` is given, the replace reference must not yet exist in
24 `.git/refs/replace/` directory.
26 Replace references will be used by default by all git commands except
27 those doing reachability traversal (prune, pack transfer and fsck).
29 It is possible to disable use of replacement refs for any command
30 using the --no-replace-objects option just after "git".
32 For example if commit "foo" has been replaced by commit "bar":
34 ------------------------------------------------
35 $ git --no-replace-object cat-file commit foo
36 ------------------------------------------------
38 show information about commit "foo", while:
40 ------------------------------------------------
41 $ git cat-file commit foo
42 ------------------------------------------------
44 show information about commit "bar".
46 OPTIONS
47 -------
48 -f::
49         If an existing replace ref for the same object exists, it will
50         be overwritten (instead of failing).
52 -d::
53         Delete existing replace refs for the given objects.
55 -l <pattern>::
56         List replace refs for objects that match the given pattern (or
57         all if no pattern is given).
58         Typing "git replace" without arguments, also lists all replace
59         refs.
61 BUGS
62 ----
63 Comparing blobs or trees that have been replaced with those that
64 replace them will not work properly. And using 'git reset --hard' to
65 go back to a replaced commit will move the branch to the replacement
66 commit instead of the replaced commit.
68 There may be other problems when using 'git rev-list' related to
69 pending objects. And of course things may break if an object of one
70 type is replaced by an object of another type (for example a blob
71 replaced by a commit).
73 SEE ALSO
74 --------
75 linkgit:git-tag[1]
76 linkgit:git-branch[1]
77 linkgit:git[1]
79 Author
80 ------
81 Written by Christian Couder <chriscool@tuxfamily.org> and Junio C
82 Hamano <gitster@pobox.com>, based on 'git tag' by Kristian Hogsberg
83 <krh@redhat.com> and Carlos Rica <jasampler@gmail.com>.
85 Documentation
86 --------------
87 Documentation by Christian Couder <chriscool@tuxfamily.org> and the
88 git-list <git@vger.kernel.org>, based on 'git tag' documentation.
90 GIT
91 ---
92 Part of the linkgit:git[1] suite