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}`
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>...]'