Git stash

  • git stash save "<message>"
    will stash and the save the message of stash.
  • git stash list
    will show list of all stashes and their messages.
  •  git stash show stash@{<stash number>}
    will show the change of the stash number.
  • git stash apply stash@{<stash number>}
    will apply the stash number on the working directory.
  • git stash drop stash@{<stash number>}
    drop/delete the stash number.
  • git stash clean
    will delete all stashes.
  • git stash -u
    will stash everything, including untracked files.
  • git stash branch <branch-name>
    will create a new branch with the name branch-name, and apply the last stash to it, and drop the last stash.

stash are organized in LIFO (last in first our structure) , the last recent stash has the number 0

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s