From aa24f4409b84a818f55b789e782ed43b8e039c53 Mon Sep 17 00:00:00 2001 From: Mat M Date: Sun, 26 Aug 2018 00:36:38 -0400 Subject: [PATCH] Add a scenario C, where one wants to append changes to the most recent commit they made. --- Typical-Git-Workflow.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Typical-Git-Workflow.md b/Typical-Git-Workflow.md index ebbbc50..9bd804d 100644 --- a/Typical-Git-Workflow.md +++ b/Typical-Git-Workflow.md @@ -40,6 +40,20 @@ It's appreciated if every single commit in a branch on its own compiles on all s * `git checkout new-branch-name` * `git rebase -i upstream/master` +## Scenario C: I made a commit and want to add other changes to it + +To append changes to the most recently made commit, simply: + +1. Stage the changed files to append to the commit with either: + * `git add ` + * or `git add -u` to stage all modified files. + +2. Enter: + * `git commit --amend` — if you want to also change your commit message + * `git commit --amend --no-edit` — if you want to append your changes to the commit and make no changes to the commit message + +3. Done + ## Your branch is getting near completion, now you're ready for a pull request! 1. From your branch, rebase `upstream/master`