Describe how to reword the most recent commit message

This is useful for when you realize that you forgot to mention
something important, made a typo, etc.  Obviously you should avoid
using this on a commit which you have already pushed.

Signed-off-by: Eric James Michael Ritz <ejmr@plutono.com>
This commit is contained in:
Eric James Michael Ritz 2015-07-29 18:58:03 -04:00
parent 76c268f284
commit 3e926cdc9e
2 changed files with 10 additions and 0 deletions

View File

@ -19,6 +19,7 @@
* [Delete local branch](https://github.com/git-tips/tips#delete-local-branch)
* [Delete remote branch](https://github.com/git-tips/tips#delete-remote-branch)
* [Undo local changes with the last content in head](https://github.com/git-tips/tips#undo-local-changes-with-the-last-content-in-head)
* [Reword the previous commit message](https://github.com/git-tips/tips#reword-the-previous-commit-message)
* [Changing a remote's URL](https://github.com/git-tips/tips#changing-a-remotes-url)
* [Get list of all remote references](https://github.com/git-tips/tips#get-list-of-all-remote-references)
* [Get list of all local and remote branches](https://github.com/git-tips/tips#get-list-of-all-local-and-remote-branches)
@ -130,6 +131,11 @@ git push origin :<remote_branchname>
git checkout -- <file_name>
```
## Reword the previous commit message
```sh
git commit -v --amend
```
## Changing a remote's URL
```sh
git remote set-url origin <URL>

View File

@ -64,6 +64,10 @@
"title": "Undo local changes with the last content in head",
"tip": "git checkout -- <file_name>"
},
{
"title": "Reword the previous commit message",
"tip": "git commit -v --amend"
},
{
"title": "Changing a remote's URL",
"tip": "git remote set-url origin <URL>"