All the hidden and not hidden features of GitHub. Taken from Zach Holmans talk at Aloha Ruby Conference 2012.
Adding ?w=1
to any diff URL will remove any changes only in whitespace, enabling you to see only that code that has changed.
When cloning a repo the .git
can be left off the edge.
$ git clone https://github.com/tiimgreen/github-cheat-sheet
Hub is a command line tool that wraps git in order to extend it with extra features and commands that make working with GitHub easier.
This allows you to do things like:
$ hub clone tiimgreen/toc
Which translates to:
$ git clone git://github.com/tiimgreen/toc.git
git.io is a simple URL shortner for GitHub.
Gists are an easy way to work with small bits of code without creating a fully fledged repo.
Gists are also full repos so can be cloned like any other:
$ git clone https://gist.github.com/tiimgreen/10545817
When on a repo page keyboard shortcust allow you to navigate easily.
Pressing t
will bring up a file explorer.
Pressing w
will bring up the branch selector.
Pressing s
will select the search bar.
To see all of the sortcuts for given page type shift+?
If a particular commit fixes an issue, any of the keywords fix/fixes/fixed
or close/closes/closed
, followed by the issue number, will close the issue.
$ git commit -m "Refactor code, fixes #12"
If you want to link to another issue in the same repo, simple type hash #
then the issue number, it will be auto-linked.
To link to an issue in another repo, user_name/repo_name#ISSUE_NUMBER
e.g. tiimgreen/toc#12
.
Emojis can be generated on Pull Requests, Issues, READMEs, etc. using :name_of_emoji:
:smile:
:poop:
😄 💩
The full list of supported Emojis on GitHub can be found here.