Skip to content

Commit 908ae03

Browse files
committed
Merge pull request #31 from p-v/amend-patch
Tip to amend last commit
2 parents 5c85e36 + 97ea968 commit 908ae03

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
* [Rename a branch](https://github.com/git-tips/tips#rename-a-branch)
5353
* [rebases 'feature' to 'master' and merges it in to master ](https://github.com/git-tips/tips#rebases-feature-to-master-and-merges-it-in-to-master)
5454
* [Archive the `master` branch](https://github.com/git-tips/tips#archive-the-master-branch)
55+
* [Modify previous commit without modifying the commit message](https://github.com/git-tips/tips#modify-previous-commit-without-modifying-the-commit-message)
5556

5657
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
5758
<!-- @doxie.inject end toc -->
@@ -365,5 +366,10 @@ git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1
365366
git archive master --format=zip --output=master.zip
366367
```
367368

369+
## Modify previous commit without modifying the commit message
370+
```sh
371+
git add --all && git commit --amend --no-edit
372+
```
373+
368374
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
369375
<!-- @doxie.inject end -->

tips.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,5 +204,9 @@
204204
{
205205
"title": "Archive the `master` branch",
206206
"tip": "git archive master --format=zip --output=master.zip"
207+
},
208+
{
209+
"title": "Modify previous commit without modifying the commit message",
210+
"tip": "git add --all && git commit --amend --no-edit"
207211
}
208212
]

0 commit comments

Comments
 (0)