From bf3aef902d4ca3d6c81e78625c0e58ab5f5a6795 Mon Sep 17 00:00:00 2001 From: Salvatore McCarty Date: Tue, 29 Oct 2019 17:09:47 -0700 Subject: [PATCH] [Hacktoberfest] Add git commit amend snippet --- source/snippets/git/index.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/snippets/git/index.md b/source/snippets/git/index.md index 994df76..f83076a 100644 --- a/source/snippets/git/index.md +++ b/source/snippets/git/index.md @@ -48,12 +48,21 @@ A stands for All ### Record changes to the repository -Use the given as the commit message. If multiple -m options are given, their values are concatenated as separate paragraphs. +Use the given `` as the commit message. If multiple -m options are given, their values are concatenated as separate paragraphs. ```bash -git commit -m"your commit message" +git commit -m "your commit message" ``` +### Rewrite the most recent commit message + +Did you mess up with your `` and need to update it before pushing it upstream? +```bash +git commit --amend +``` + +Then press **Enter** -> this will open your old message in your default text editor, edit the message, and save the commit. + --- ## Repositories