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