 All right. So you've got to talk about stashing with Git. I didn't realize that during the course of the session that it would actually be useful. So my name is Angela Rohit. That's my handle. You can find me on GitHub, obviously, Twitter, and 500px. So what is stashing? And this is just some dry stuff. You know what? If you see this and go like this, it's totally fine. Because this doesn't make sense. So we're going to look at a scenario. OK, so you're working on your awesome product. And halfway through, your boss comes over and says, you know what? There is a big bug on the release branch. And it has to be fixed immediately. You've probably seen this before. I mean, most bosses are like that. So what do you do next? What do you do next? So you're probably sitting there looking like that. And your boss is probably tearing his hair out because it's a big bug. So there was a gentleman there earlier. And he mentioned that some of his colleagues copy the files out. You could do that. But then don't cry if you get somebody overrides your changes. So you could do that. Or you could create another branch and commit your changes onto that branch, which is. So of all the things, let's say you weren't using Git, let's say you were using SVN. You probably have to do stuff like that. Because SVN, you can do another thing. You can create a patch, which is, again, the whole point of it is destroyed. So for multiple reasons, you either have inelegant, infeasible, or just plain, insane ways of doing this. So that's where GitStash comes in. And GitStash is probably, I mean, when I first heard about GitStashing, I was like, wow, this thing is awesome. So OK, in our hypothetical scenario, you type git status hypheness. And I can see there is one file that I have modified. There may have been more. But in this particular case, I choose to choose names like super awesome file.cpp. And Ryan is probably going to kill me for that. So GitStash, what this does is it takes all of your uncommitted changes and puts them onto a stack. And you can have multiple stashes on a stack. And you can pop from that stack. Or you can take the individual stash and apply that. Again, does it make too much sense if we continue with the scenario? So I just stashed my changes. I gave it a name. My super awesome changes. But as programmers, we are all paranoid. Just because the computer says it did something, it doesn't mean that it actually did it. So we're going to have to check that. We're going to have to check whether your computer, are you lying? So I do GitStash list. And there you go. My super awesome changes are there. It's at the top. It's given an index of 0. If I want to see more details into that particular stash, I can say, GitStash show stash at 0. And I can see that this is the particular file which was modified in the first place. So what I've done is all of my changes, which I was working on. I was halfway through something when my boss interrupted me. And I took all of those uncommitted changes and I put them into a stash. Now I'm totally free. So super awesome file is in the stash. Now you can switch to your release branch, make the fix, be awesome, stuff like that. Then you switch back to your feature branch, the one where you were working initially. And you get back stash changes by saying, GitStash, apply. Very simple, right? And it's so awesome I didn't have to copy files out or create another branch. I didn't have to do any of that. It was really, really simple. And yeah, thumbs up. You gave the stash a name. You don't have to use it. You don't have to use it. It's just for you to see so that I know what this stash is. Because I can have multiple stashes. I can have different stashes all at the same time. I can apply them individually if I so wish. And if you do that, you've got a specified name to apply. No, you specify that one, stash, at, and the index. You say, GitStash, apply and stash, at, and the index. But you can see the names in GitStash list, which is useful for you to know what this stash is, what are these things that have been done. So this is like pushing the M plus some calculator. And then push 10 more. I wish, I wish it were that simple, but no. All right, so stashing is actually very powerful. I've just covered, just crashed the surface. It's actually very powerful. You can stash untrack files. For example, in this particular case, I had a modified file, it was easy to stash it. But what if I never, it's a new file, I just created it. You can't stash something that Git doesn't know about, right? But you can. And you can stash if you want. Particular files, not all your files, you can stash some files, or even portions of files. You can apply specific stashes as you asked. So you can do all of these things, you can do more. Any questions? You stash one file, and then it goes away from your working directory, and it gets stashed. So you can't stash it again, because it's already stashed. Pardon? Every time we need to use stash on something, it's created to track it down. It gets stored into your stash list, and that's where you see it. But even if you've already stashed the file, you can't stash it again. So a portion of a file, so what happens is you've made changes into a file, and you have what we call, the portions are called hunks. It's just, it's not an attractive mail, it's just, and what they are, is you can see the portions by doing git stash-p, and you can actually see interactively what are the portions of the file that you have changed, and you can stash them individually. I encourage you to go out and check out the man pages, or bro pages, whatever it is. I mean, that's the thing, I didn't make that up. That's actually the thing. Does the intakes change when you use stash when you use the intakes file onto the stash? Pardon, say again? Okay, is it a last instance of when you stash the second one, so the intakes changes from zero to one? Yes, it's a stack. Do you have any recommendations for when to delete your stash? If you don't need it. Why else would you delete something? So I mean, after you pop it, is that usually when you delete it? Yeah, yeah, so let's say you can pop it, and it doesn't mean that you want it deleted immediately because you may just want to play with it a little more before it, you know, it just can't be changed. So if you pop it and then you're ready to go, you can delete it later. That's probably in a cleanup later, you can see, oh, I've got all of these stashes, I don't need them anymore, you can delete them and do it yourself. Sorry, it says you could stash on track files, is it do it by default? No, no, you have to do get stash-new, and that's fine. And then you'll take in whatever. It'll take everything that's in that direction. Yeah, yeah. Now you will, I was working on a file, and it was fixed, it was fixed that it was working on. Okay. Okay. But, coincidentally, other files was on the same file. Okay. And then the file did no changes, and then it started working on that. Okay. And then I commit that file. Okay. How do I bring back this stash? You can still bring it back, get stash-apply, you can always bring it back. But it, will it have both the changes which are committed? You may have much conflicts, depending. So when you bring it back, basically it tries to merge it. So you will have, in your case, you would have much conflicts, yeah. Any more questions? So when we rename a file, does the stash, what's the message? When you rename a file? Yeah. You can rename the file that has been stashed. Okay. The stash changes are separate from what you're doing. Stash, basically, when I stashed, my working director is now clean. So you can, I mean, there's no changes in there. Does that make sense? No. Ha ha ha. Okay, cool. Thank you very much.