5.3 Advanced Actions
Atom allows for more advanced Git actions beyond keybindings and file coloring. In this lesson we'll learn how to revert changes and find only modified files.
1.Introduction1 lesson, 01:29
2.The Basics2 lessons, 06:52
3.Getting Around4 lessons, 10:53
4.Snippets4 lessons, 15:59
5.Deep Git Integration3 lessons, 08:48
6.Packages9 lessons, 40:23
7.Automating Workflows4 lessons, 15:31
8.Conclusion1 lesson, 00:28
5.3 Advanced Actions
We've been able to minimize the places that we have to switch back and forth between Adam and GitHub. However we can still spend sometime switching back and forth between the editor and our terminal. Or the GitHub GUI if you prefer that. We'd really like to use the editor as much as we can. In this lesson we're going to learn a couple tricks that'll keep us in editor for a bit longer. In the current file we have opened up, we can see that we have these changes indicated by the diff lines. If we didn't want these changes applied, we'd usually have to go back to the terminal. And from within the terminal, we would have to say get reset. And then we would do --hard. And then now as we fired this off, it lets us know that we've got back to the head. And back in the editor, we can see that our animal module has been removed. If we hit Ctrl+Z, we'll get the animal module back. Ideally, we wouldn't want to have to go back to the terminal to do this. So, one thing we can do, is we actually can reset back to head with an atom. Using the command palette, we can see the key binding for this is Option Command Z. so now we hit option Cmd+z, and we didn't see anything happen. So let's actually open it up in the command palette again. And we'll hit Enter from here. And nothing even happened then. And the trick with this, is this file actually needs to be saved. So now that we save it, and we hit option Cmd+Z our animal module disappears because we've switched back to the head. So the key thing to remember is that we need to have the file saved and then hit option Cmd+Z. So now let's go and make that modification once more and we'll save. And then we'll also go into our index.html file and we'll make a change in here as well. It doesn't really matter what we do so we'll just add a ul. Now that we have these two files modified, let's close out of both of them. So let's say we were making a lot of different edits and multiple files. We only wanted to see the files that were changed. We know we can hit cmd+P to open up all the files. We might notice this little icon next to another JS and index.html and this lets us know that these files have been modified. So what we want to see is only these two files in a list, since they're the only files that have been modified. Well, to do that, we can actually hit Cmd+Shift+B, and this will bring up all the files that have currently been modified, so we can open up another JS from there. So that's just Cmd+Shift+B. So these are some of the more advanced actions that we can do with an atom. But there's still some things we have to go to the terminal to do and we'll learn that there's actually a package out there that allows us to do more gig functionality inside of atom. So in the next lesson, we'll get up and running with packages.