Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m
by
Lessons:28Length:1.7 hours
Speedy workflows with atom.io
  • Overview
  • Transcript

5.2 GitHub Keymaps

Now we know a couple really cool integrations with Git, but we're still switching back and forth between GitHub and the editor quite often. Fortunately, there are a couple keybindings that we can use to remedy this. In the previous video, we talked about the diff lines, and the diff lines are the colorings in the left gutter that tell us there's been changes made to this file. the green line that stretches from 15 to 24 tell us that this file has been added since this file has been checked into source control. In the real world where you are going to modifying a bigger file that has a lot of changes, it will be really awesome to have a way where we can cycle through all these changes. We can do that with Atom. We can hit option G and then we can hit up. And what this does is it highlights the very first change. Now if we hit option G and then down, we go back to this change. So hitting option G, and then letting up, and then hitting either up or down, we can cycle through all the changes that have happened in this file. Another thing that we commonly find ourselves doing in GitHub, is checking to see what the current code looks like that's checked in. And we usually have to do this by going out to GitHub, and once we're in our repo, we then have to go click into this file, and then we can scroll to whatever change that we're looking for. However in Atom there's an easier way to do this. If we select line four and hit Option + G and now hit O, this will open up the file in GetHub at that selected line. We can see that four is actually highlighted. This is really powerful to use. We can go get into GitHub without having to navigate there ourselves. And also as we're making edits if we're wondering what the history of this file is we can usually open that as well. By hitting option G then h. This shows us the commit history to this file. In this case we just have one but if we're needing to access a previous commit from this file we can easily hit option g then h. And now we can go and look into any previous commits. Sometimes when we're looking through the code, too, something doesn't really look right and we wanna know who we can blame. And fortunately Git has a feature for that called blame. So if we're looking at this module function saying this looks really bad, we need to know who did this. We hit option G, then we hit b. And then when we get into the blame we can see that we actually did it so we can just blame ourselves. Well really just me in this case. A lot of the time we ask someone to take a look at the code so we send them a link. Usually this would require going out to git hub and copying the URL and then going back and sending it over. In this case we can get the link by saying option G then typing C. Now if we hit Ctrl+V, we see the link that gets us out to this file. So remember that option G is the base key binding that gets us into actions with GitHub. After that, we can use the arrow keys, or we can enter o, h, b, or c to do specific actions into GitHub. And this will really remove a lot of the time that it would take to pull this stuff up manually. So these are really convenient key bindings, but they're pretty basic. So in the next lesson, we'll take a look at some of the more advanced actions we can use with the GitHub.

Back to the top