69f704faf8e36c17baa22af1aff64119811f7ba5
   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
  26Replacement references will be used by default by all git commands
  27except those doing reachability traversal (prune, pack transfer and
  28fsck).
  29
  30It is possible to disable use of replacement references for any
  31command using the `--no-replace-objects` option just after 'git'.
  32
  33For example if commit 'foo' has been replaced by commit 'bar':
  34
  35------------------------------------------------
  36$ git --no-replace-objects cat-file commit foo
  37------------------------------------------------
  38
  39shows information about commit 'foo', while:
  40
  41------------------------------------------------
  42$ git cat-file commit foo
  43------------------------------------------------
  44
  45shows information about commit 'bar'.
  46
  47OPTIONS
  48-------
  49-f::
  50        If an existing replace ref for the same object exists, it will
  51        be overwritten (instead of failing).
  52
  53-d::
  54        Delete existing replace refs for the given objects.
  55
  56-l <pattern>::
  57        List replace refs for objects that match the given pattern (or
  58        all if no pattern is given).
  59        Typing "git replace" without arguments, also lists all replace
  60        refs.
  61
  62BUGS
  63----
  64Comparing blobs or trees that have been replaced with those that
  65replace them will not work properly. And using 'git reset --hard' to
  66go back to a replaced commit will move the branch to the replacement
  67commit instead of the replaced commit.
  68
  69There may be other problems when using 'git rev-list' related to
  70pending objects. And of course things may break if an object of one
  71type is replaced by an object of another type (for example a blob
  72replaced by a commit).
  73
  74SEE ALSO
  75--------
  76linkgit:git-tag[1]
  77linkgit:git-branch[1]
  78linkgit:git[1]
  79
  80Author
  81------
  82Written by Christian Couder <chriscool@tuxfamily.org> and Junio C
  83Hamano <gitster@pobox.com>, based on 'git tag' by Kristian Hogsberg
  84<krh@redhat.com> and Carlos Rica <jasampler@gmail.com>.
  85
  86Documentation
  87--------------
  88Documentation by Christian Couder <chriscool@tuxfamily.org> and the
  89git-list <git@vger.kernel.org>, based on 'git tag' documentation.
  90
  91GIT
  92---
  93Part of the linkgit:git[1] suite