Last active
February 4, 2016 06:41
-
-
Save kavitshah8/73cbec7e3ccece226448 to your computer and use it in GitHub Desktop.
Git amend use cases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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