Skip to content

Commit ee6a12a

Browse files
committed
Add page on amending the last commit message
1 parent 3a96903 commit ee6a12a

2 files changed

Lines changed: 23 additions & 5 deletions

File tree

index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ minimal guide to get started.
1818
and diff.
1919
- [Start a new repository](pages/init.html): from scratch, or with an
2020
existing project.
21-
- [Contribute to someone's repository](pages/fork.html)
22-
- [Handling merge conflicts](pages/merge_conflicts.html)
23-
- Oops; that last commit message was wrong
24-
- Exploring the code and its history
25-
- Resources
21+
- [Contribute to someone's repository](pages/fork.html): fork.
22+
- [Handling merge conflicts](pages/merge_conflicts.html).
23+
- [Oops; that last commit message was wrong](pages/amend_commit_msg.html).
24+
- [Exploring the code and its history](pages/exploring_code.html).
25+
- [Other (much more thorough) resources](pages/resources).
2626

2727
I love git and github. I
2828
use both for keeping track of programming projects, papers, talks, and

pages/amend_commit_msg.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
layout: page
3+
title: Amend the last commit message
4+
---
5+
6+
“Oops! That last commit message was screwed up.
7+
[How do I edit an incorrect commit message?](http://stackoverflow.com/questions/179123/how-do-i-edit-an-incorrect-commit-message-in-git)”
8+
9+
This usually happens to me when I intended to use just `git commit`
10+
but typed `git commit -a` and committed a whole bunch of more stuff
11+
that I hadn't mentioned in the commit message.
12+
13+
It's easy to fix just the message for the last commit:
14+
15+
$ git commit --amend -m "New commit message"
16+
17+
Or leave off the `-m "New commit message"` and type the message in the
18+
text editor that opens.

0 commit comments

Comments
 (0)