2017年1月21日星期六
Git: stash and checkout
As we know, if you want to checkout, you must need to clean your working DIR.
That's it, create a commit or stash you change.
Stash, means save your files on a temporary place in a stack data structure.
Below is a example on this.
We have un-stage files on the working directory. So , the working DIR is not clean.
If we want to checkout, Git give you below error
But I don't want to commit . Therefore, stash the files.
Working DIR is clean now!!
Perfect!! Checkout then.No problem on checkout!!
Go back to our master
Same as my expected, my working DIR is clean.
Lets get it back of my previous work on the master.
Here we are, my works back! Welcome home~~
Conclusion
For me, it is not efficiency….I rather than just simply commit it then checkout.
Stash is not much useful….
This is just for my interest to know how stash work.Ha!
訂閱:
發佈留言 (Atom)
沒有留言:
發佈留言