LinuxCommandLibrary

git-replace

Create, list, or delete object replacement refs

TLDR

Replace object

$ git replace [object] [replacement]
copy
List replacements
$ git replace -l
copy
Delete replacement
$ git replace -d [object]
copy
Graft commit parents
$ git replace --graft [commit] [parent1] [parent2]
copy

SYNOPSIS

git replace [options] object replacement

DESCRIPTION

git replace creates, lists, or deletes refs that substitute one object for another. This allows temporarily changing how objects are viewed without modifying the original objects themselves.
Replacements are useful for fixing published history, grafting histories together, or replacing large blobs. The `--graft` option simplifies rewriting commit parentage.

PARAMETERS

-l, --list

List replacements.
-d, --delete
Delete replacement.
-f, --force
Force replacement.
--graft
Create graft commit.
--edit
Edit replacement.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community