From 545a53e808c566fe7464ef2901c5ea8f0f862f44 Mon Sep 17 00:00:00 2001 From: Filipp Pirozhkov Date: Fri, 10 Nov 2017 19:18:27 +0300 Subject: [PATCH 1/3] Change the command to minimize side effects --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 21d0ee2..b43b7f9 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ In order to remove a file from a commit, do the following: ```sh $ git checkout HEAD^ myfile -$ git add -A +$ git add myfile $ git commit --amend ``` From f60cd9d8352d0a7e28deb8a742fa1200f4dd62ec Mon Sep 17 00:00:00 2001 From: Filipp Pirozhkov Date: Fri, 10 Nov 2017 19:20:46 +0300 Subject: [PATCH 2/3] Change command to avoid editing commit message --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b43b7f9..06d07bd 100644 --- a/README.md +++ b/README.md @@ -133,10 +133,11 @@ In order to remove a file from a commit, do the following: ```sh $ git checkout HEAD^ myfile $ git add myfile -$ git commit --amend +$ git commit --amend --no-edit ``` This is particularly useful when you have an open patch and you have committed an unnecessary file, and need to force push to update the patch on a remote. +`--no-edit` option is used to keep the existing commit message. ### I want to delete or remove my last commit From 186ed0a1e42e76be1d5b43d651bd2b12e1adcb45 Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Sun, 12 Nov 2017 10:31:50 -0500 Subject: [PATCH 3/3] docs: small grammar fix --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 06d07bd..909f32a 100644 --- a/README.md +++ b/README.md @@ -136,8 +136,7 @@ $ git add myfile $ git commit --amend --no-edit ``` -This is particularly useful when you have an open patch and you have committed an unnecessary file, and need to force push to update the patch on a remote. -`--no-edit` option is used to keep the existing commit message. +This is particularly useful when you have an open patch and you have committed an unnecessary file, and need to force push to update the patch on a remote. The `--no-edit` option is used to keep the existing commit message. ### I want to delete or remove my last commit