Say you have changed some files. Issuing the git status would show what has changed.
$ git stash // Temporarily hide your changes. Now issue git status. You won't see the modifications. Equivalent to $ git stash save $ git stash save --patch // Opens the text editor to choose what portion to stash $ git stash apply // Apply the last stashed change and keep the stash in stack. But this is normally not done. Instead following is done $ git stash pop // Apply the last stashed change and remove it from stack $ git stash list // Shows available stashes.Stashes have name in the format of stash@{#} where # is 0 for most recent one and 1 for the second recent and so on.
$ git stash drop <stash name> // e.g: git stash drop stash@{0} to remove the first stash $ git stash clear // Remove all the stashed changes $ git stash branch <stash name> // Create a branch from an existing stashIn the next part of this series we'll discuss git branching in detail.
No comments:
Post a Comment