Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit 4e7da78

Browse files
authored
Merge pull request #129 from salmccarty/salmac86/add_git_snippet
[Hacktoberfest] Add git commit amend snippet
2 parents 04ceff1 + bf3aef9 commit 4e7da78

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

source/snippets/git/index.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,21 @@ A stands for All
4848

4949
### Record changes to the repository
5050

51-
Use the given <msg> as the commit message. If multiple -m options are given, their values are concatenated as separate paragraphs.
51+
Use the given `<msg>` as the commit message. If multiple -m options are given, their values are concatenated as separate paragraphs.
5252

5353
```bash
54-
git commit -m"your commit message"
54+
git commit -m "your commit message"
5555
```
5656

57+
### Rewrite the most recent commit message
58+
59+
Did you mess up with your `<msg>` and need to update it before pushing it upstream?
60+
```bash
61+
git commit --amend
62+
```
63+
64+
Then press **Enter** -> this will open your old message in your default text editor, edit the message, and save the commit.
65+
5766
---
5867

5968
## Repositories

0 commit comments

Comments
 (0)