是否有最大数量的git stashes,或者你有多少你喜欢?
我知道
git stash list
Run Code Online (Sandbox Code Playgroud)
没有列出尽可能多的结果
git stash list --date=local
Run Code Online (Sandbox Code Playgroud)
但Linus Torvalds是否认为任何拥有超过x stashes的人都是一个值得失去旧皮带的白痴?
不,没有限制.事实上,Git非常优雅地处理大量的藏匿处:
$ du -sh .git; \
> for i in {1..10000}; do echo $i > README; git stash -q; done; \
> git gc -q; du -sh .git; time git stash list | wc -l
8.5M .git
13M .git # space efficient
10000 # all there
real 0m0.212s # listing 10,000 entries
$ echo foo > README; time git stash -q; time git stash pop -q
real 0m0.159s # save still fast
real 0m0.146s # pop still fast
Run Code Online (Sandbox Code Playgroud)
我没有测试更多,但我认为它仍然可以工作相同的100,000或一百万.所以是的,存储的数量确实是无限的.