mirror of
https://github.com/mike-rambil/Advanced-Git.git
synced 2026-04-29 11:46:39 -05:00
36 lines
607 B
Markdown
36 lines
607 B
Markdown
[⬅️ Back to Useful Rare Git Commands You Never Heard Of](./useful-rare-git-commands-you-never-heard-of.md)
|
|
|
|
# git replace <old-commit> <new-commit>
|
|
|
|
|
|

|
|
> Temporarily substitute one commit for another.
|
|
|
|
|
|
#### Command
|
|
```sh
|
|
git replace abc123 def456
|
|
```
|
|
|
|
#### Examples
|
|
- **Temporarily replace commit abc123 with def456.**
|
|
|
|
|
|
```sh
|
|
git replace abc123 def456
|
|
```
|
|
|
|
|
|
#### Steps
|
|
1. Run `git replace <old-commit> <new-commit>` to test or patch history.
|
|
|
|
|
|
#### Tags
|
|
`replace`, `history`
|
|
|
|
#### Author
|
|
mike-rambil
|
|
|
|
#### Last Updated
|
|
2024-06-10
|