NataliaLKB / learn-git-basics

A Beginner's Guide to Git
63 stars 116 forks source link

A Note on git stash #48

Closed harrygfox closed 7 years ago

harrygfox commented 9 years ago

I would love to see a little explanation on the use of git stash.

In my day to day I am frequently prompted to:

commit [my] changes or stash them before [I] can switch branches.

I have recently discovered the utility of stashing, making changes and committing and then "popping" the stash to return to where I was. The examples on git-scm docs have been particularly useful.

What do you think? Would this be something to be made aware of as a beginner? It takes a bit of understanding of the state of your current branch and the other branch you're working with so maybe not?

Anyway, if you decide to add in this feature, I'd love to see how you word it!

NataliaLKB commented 9 years ago

@harrygfox I really do like using stash.

However beginners tend to use stashing as a garbage dump instead of a temporary store. Initially this made me quite wary of encouraging its use. However it is such a beneficial tool. Certainly if we include it we will need some examples of when to use and when not to.

Do you have time to put in a PR starting this section off?

Let me know. This is a great suggestion!

FilWisher commented 8 years ago

However beginners tend to use stashing as a garbage dump instead of a temporary store.

Oi!

harrygfox commented 8 years ago

Haha @FilWisher! Ever the beginner :)

NataliaLKB commented 7 years ago

@harrygfox Closing this unless you want to make a PR. Been open now for ages