Skip to content

Instantly share code, notes, and snippets.

@kavitshah8
Last active February 4, 2016 06:41
Show Gist options
  • Save kavitshah8/73cbec7e3ccece226448 to your computer and use it in GitHub Desktop.
Save kavitshah8/73cbec7e3ccece226448 to your computer and use it in GitHub Desktop.
Git amend use cases
git add .
git commit -m “adding few files”
git log --oneline
touch forgot.js // adds new file to the project
git add . // adds recently added file to the stagging
git commit --amend --no-edit // adds new file to the previous commit without changing the commit message
git log --oneline
git add .
git commit -m “initial commit”
git log --oneline // prints out "initial commit"
git commit --amend -m “first commit”
git log --oneline // prints out "first commit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment