Files
30-seconds-of-code/snippets/create-fixup-commit.md
Isabelle Viktoria Maciohsek ed2f41b0d8 Bake dates into snippets
2021-06-13 19:47:48 +03:00

24 lines
625 B
Markdown

---
title: Create a fixup commit
tags: commit,advanced
firstSeen: 2021-04-08T19:51:24+03:00
lastUpdated: 2021-04-13T21:10:59+03:00
---
Creates a fixup commit that can be autosquashed in the next rebase.
- Use `git commit --fixup <commit>` to create a fixup commit for the specified `<commit>`.
- After running `git rebase --autosquash`, fixup commits will be automatically squashed into the commits they reference.
```shell
git commit --fixup <commit>
```
```shell
git add .
git commit --fixup 3050fc0de
# Created a fixup commit for `3050fc0de`
git rebase HEAD~5 --autosquash
# Now the fixup commit has been squashed
```