From 97ea96885adc74f6fc12e99f8d8b7def96d91a62 Mon Sep 17 00:00:00 2001 From: Pratyush Date: Sat, 22 Aug 2015 19:20:06 +0530 Subject: [PATCH] tip to amend last commit --- README.md | 6 ++++++ tips.json | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index b8ee675..8b2a72a 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,7 @@ * [Rename a branch](https://github.com/git-tips/tips#rename-a-branch) * [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) * [Archive the `master` branch](https://github.com/git-tips/tips#archive-the-master-branch) +* [Modify previous commit without modifying the commit message](https://github.com/git-tips/tips#modify-previous-commit-without-modifying-the-commit-message) @@ -365,5 +366,10 @@ git checkout feature && git rebase @{-1} && git checkout @{-2} && git merge @{-1 git archive master --format=zip --output=master.zip ``` +## Modify previous commit without modifying the commit message +```sh +git add --all && git commit --amend --no-edit +``` + diff --git a/tips.json b/tips.json index 07dabae..ca9983f 100644 --- a/tips.json +++ b/tips.json @@ -204,5 +204,9 @@ { "title": "Archive the `master` branch", "tip": "git archive master --format=zip --output=master.zip" + }, + { + "title": "Modify previous commit without modifying the commit message", + "tip": "git add --all && git commit --amend --no-edit" } ]