Summary git commonly used commands

A, git stash 

1、git  stash

Save the current progress of work, the changes will save up staging area and workspace. After executing this command, run the git statuscommand, you will find the current work area is a clean, no changes. Use git stash save 'message...'can add some comments

2、git stash list

Displays a list of saved schedule. It means that git stashthe command can be executed multiple times.

3、git stash pop [–index] [stash_id]

. Git stash pop to restore the latest progress of the work area. git will change the default work area and temporary area are restored to the workspace.
. Git stash pop --index restore the latest progress of the work area and the staging area. (Try to change the original staging area is also restored to the staging area)
. Git stash stash @ POP progress of recovery specified {1} to the workspace. stash_id is obtained by the git stash list command
    by command git stash pop recovery progress will delete the current schedule.

4、git stash apply [–index] [stash_id]

    In addition to not delete the progress of recovery, rest and git stash pop command.

5、git stash drop [stash_id]

    To delete a stored schedule. If you do not specify stash_id, delete the default storage latest progress.

6、git stash clear

    Delete all stored schedule.

 

Guess you like

Origin www.cnblogs.com/ricklz/p/11489850.html