Created
October 19, 2013 06:58
-
-
Save ton1517/7052468 to your computer and use it in GitHub Desktop.
サクッと使いこなすためのgit stash Tips & stashの仕組み ref: http://qiita.com/ton1517/items/9888a78f6b063e748558
This file contains 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 status | |
# On branch master | |
# Changes to be committed: | |
# (use "git reset HEAD <file>..." to unstage) | |
# | |
# modified: bar | |
# | |
# Changes not staged for commit: | |
# (use "git add <file>..." to update what will be committed) | |
# (use "git checkout -- <file>..." to discard changes in working directory) | |
# | |
# modified: hoge | |
# |
This file contains 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 stash -k |
This file contains 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
$ ls -a | |
. .. .git bar hoge |
This file contains 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 status | |
# On branch master | |
# Changes to be committed: | |
# (use "git reset HEAD <file>..." to unstage) | |
# | |
# modified: bar | |
# | |
# Changes not staged for commit: | |
# (use "git add <file>..." to update what will be committed) | |
# (use "git checkout -- <file>..." to discard changes in working directory) | |
# | |
# modified: hoge | |
# |
This file contains 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 stash | |
$ git stash pop |
This file contains 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 status | |
# On branch master | |
# Changes not staged for commit: | |
# (use "git add <file>..." to update what will be committed) | |
# (use "git checkout -- <file>..." to discard changes in working directory) | |
# | |
# modified: bar | |
# modified: hoge | |
# | |
no changes added to commit (use "git add" and/or "git commit -a") |
This file contains 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 stash | |
$ git stash pop --index |
This file contains 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 status | |
# On branch master | |
# Changes to be committed: | |
# (use "git reset HEAD <file>..." to unstage) | |
# | |
# modified: bar | |
# | |
# Changes not staged for commit: | |
# (use "git add <file>..." to update what will be committed) | |
# (use "git checkout -- <file>..." to discard changes in working directory) | |
# | |
# modified: hoge | |
# |
This file contains 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 stash list | |
stash@{0}: WIP on master: 8b7ca77 initial commit. |
This file contains 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 log --graph stash@{0} | |
* commit ee5d8bdf21c6dfedb6b5a648241a20eff01b2418 | |
|\ Merge: 8b7ca77 9dcce8a | |
| | Author: ton <[email protected]> | |
| | Date: Sat Oct 19 14:57:25 2013 +0900 | |
| | | |
| | WIP on master: 8b7ca77 initial commit. | |
| | | |
| * commit 9dcce8af3e987391fcd1cdd2be95785b25c04944 | |
|/ Author: ton <[email protected]> | |
| Date: Sat Oct 19 14:57:25 2013 +0900 | |
| | |
| index on master: 8b7ca77 initial commit. | |
| | |
* commit 8b7ca77846392852f4c9b0304b16116369b712ce | |
Author: ton <[email protected]> | |
Date: Sat Oct 19 12:07:03 2013 +0900 | |
initial commit. |
This file contains 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
*-. commit 90c6264e964f3dea2f7d418c49491a360630b387 | |
|\ \ Merge: 8b7ca77 351051a 4ad4d67 | |
| | | Author: ton <[email protected]> | |
| | | Date: Sat Oct 19 15:41:51 2013 +0900 | |
| | | | |
| | | WIP on master: 8b7ca77 initial commit. | |
| | | | |
| | * commit 4ad4d67f4a8fd9e31da2f1e49c7f78f7b4db37f1 | |
| | Author: ton <[email protected]> | |
| | Date: Sat Oct 19 15:41:51 2013 +0900 | |
| | | |
| | untracked files on master: 8b7ca77 initial commit. | |
| | | |
| * commit 351051a076c5e0170acab6047dd15f67ac910fbe | |
|/ Author: ton <[email protected]> | |
| Date: Sat Oct 19 15:41:51 2013 +0900 | |
| | |
| index on master: 8b7ca77 initial commit. | |
| | |
* commit 8b7ca77846392852f4c9b0304b16116369b712ce | |
Author: ton <[email protected]> | |
Date: Sat Oct 19 12:07:03 2013 +0900 | |
initial commit. |
This file contains 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 status | |
# On branch master | |
# Changes to be committed: | |
# (use "git reset HEAD <file>..." to unstage) | |
# | |
# modified: bar | |
# |
This file contains 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 status | |
# On branch master | |
# Changes to be committed: | |
# (use "git reset HEAD <file>..." to unstage) | |
# | |
# modified: bar | |
# | |
# Changes not staged for commit: | |
# (use "git add <file>..." to update what will be committed) | |
# (use "git checkout -- <file>..." to discard changes in working directory) | |
# | |
# modified: hoge | |
# | |
# Untracked files: | |
# (use "git add <file>..." to include in what will be committed) | |
# | |
# foo |
This file contains 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 stash -u |
This file contains 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 status | |
# On branch master | |
nothing to commit, working directory clean |
This file contains 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 status | |
# On branch master | |
nothing to commit, working directory clean |
This file contains 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 ls-files | |
bar | |
hoge |
This file contains 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
$ ls -a | |
. .. .DS_Store .Trashes .directory .git bar hoge tags |
This file contains 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 stash -a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment