I can’t for the life of me think of an intro, so…

#1 Edit code on GitHub.com

I’m going to start with one that I think most people know (even though I didn’t know until a week ago).

When you’re in GitHub, looking at a file (any text file, any repository), there’s a little pencil up in the top right. If you click it, you can edit the file. When you’re done, hit Propose file change and GitHub will fork the repo for you and create a pull request.

Isn’t that wild? It creates the fork for you!

No need to fork and pull and change locally and push and create a PR.

Not a real PR

This is great for fixing typos and a somewhat terrible idea for editing code.

#2 Pasting images

You’re not just limited to text in comments and issue descriptions. Did you know you can paste an image straight from the clipboard? When you paste, you’ll see it gets uploaded (to the ‘cloud’, no doubt) and becomes the markdown for showing an image.

Neat.

#3 Formatting code

If you want to write a code block, you can start with three backticks — just like you learned when you read the Mastering Markdown page — and GitHub will make an attempt to guess what language you’re writing.

But if you’re posting a snippet of something like Vue, Typescript or JSX, you can specify that explicitly to get the right highlighting.

Note the ```jsx on the first line here:

…which means the snippet is rendered correctly:

(This extends to gists, by the way. If you give a gist the extension of .jsx you’ll get JSX syntax highlighting.)

Here’s a list of all the supported syntaxes.

#4 Closing issues with magic words in PRs

Let’s say you’re creating a pull request that fixes issue #234. You can put the text “fixes #234” in the description of your PR (or indeed anywhere in any comment on the PR).

Then, merging the PR automagically closes that issue. Isn’t that cool?

There’s more to learn in the help.

#5 Linking to comments

Have you even wanted to link to a particular comment but couldn’t work out how? That’s because you don’t know how to do it. But those days are behind you my friend, because I am here to tell you that clicking on the date/time next to the name is how you link to a comment.

Hey, gaearon got a picture!

#6 Linking to code

So you want to link to a specific line of code. I get that.

Try this: while looking at the file, click the line number next to said code.

Whoa, did you see that? The URL was updated with the line number! If you hold down shift and click another line number, SHAZAAM, the URL is updated again and now you’ve highlighted a range of lines.

Sharing that URL will link to this file and those lines. But hold on, that’s pointing to the current branch. What if the file changes? Perhaps a permalink to the file in its current state is what you’re after.

I’m lazy so I’ve done all of the above in one screenshot:

Speaking of URLs…

#7 Using the GitHub URL like the command line

Navigating around GitHub using the UI is all well and fine. But sometimes the fastest way to get where you want to be is just to type it in the URL. For example, if I want to jump to a branch that I’m working on and see the diff with master, I can type /compare/branch-name after my repo name.

That will land me on the diff page for that branch: