Git encryption problem

I have a problem in git stash.

Say, for example, I have 3 files, say a.txt,b.txt & c.txtin a repo, and the directory is clean.

Now I change among these 2 files: a.txt and b.txt.

Now I have not completed my changes in two files, so I will copy them with the foll command:

$ git stash save "First Stash"

No, if I do $ git stash list, I get

stash@{0}: On master: First Stash

No, if I modify the third text file c.txtand save it as shown:

$ git stash save "Second Stash"

No, if I do $git stash list, I get a foll result,

stash@{0}: On master: Second stash
stash@{1}: On master: First Stash

The number and messages are listed here. What is going on here? Now, if I pulled it out stash@{0}, I get the first content, but the message here is canceled, which appears as a second cache, but should have been the first click.

This is my workflow.

admin:stud:/demo/stash_demo> ls
a.txt  b.txt
admin:stud:/demo/stash_demo> echo Hello World >> a.txt
admin:stud:/demo/stash_demo> git stash save "First"
Saved working directory and index state On master: First
HEAD is now at cff03c6 Initail Commit
admin:stud:/demo/stash_demo> echo Hello World >> b.txt
admin:stud:/demo/stash_demo> git stash save "Second"
Saved working directory and index state On master: Second
HEAD is now at cff03c6 Initail Commit

These are my available stamps:

admin:stud:/demo/stash_demo> git stash list
stash@{0}: On master: Second
stash@{1}: On master: First

stash @{1}, a.txt

admin:stud:/demo/stash_demo> git stash apply `stash@{1}`
# 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:   b.txt
#
no changes added to commit (use "git add" and/or "git commit -a")

, .

``, foll.

admin:stud:/demo/stash_demo> git stash apply stash@{1}
fatal: ambiguous argument 'stash@1': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
+5
2

Git stash ( ) LIFO.

git stash apply git stash pop, ( , stash@{0}, 0 - ). , (stash@{0} stash@{1}).

, , , , ref :

$ git stash apply stash@{1}
+5

!

Stashing "commits" ( , ) :

http://en.wikipedia.org/wiki/Stack_(abstract_data_type)

, .

edit: - , (stash) - - - .

/:

git stash pop 

( , )

git stash pop,

- : http://gitready.com/advanced/2009/03/20/reorder-commits-with-rebase.html ( .. , , )

+1

All Articles