Thursday, 26 January 2017

What is the difference between git stash and git commit?

git stash -- The command saves your local modifications away and reverts the working directory to match the HEAD commit. It allows you to store your uncommited modifications into a buffer area called stash, and deletes it from the branch you are working on. You may later retreive them by applying the stash.

git commit -- This records your change for next push and this event is recorded in history too.

No comments:

Post a Comment