All the hidden and not hidden features of Git and GitHub. This cheat sheet was inspired by Zach Holman's Git and GitHub Secrets talk at Aloha Ruby Conference 2012 (slides) and his More Git and GitHub Secrets talk at WDCNZ 2013 (slides).
- Ignore Whitespace
- Cloning a Repo
- Hub - Git Wrapper
- Previous Branch
- git.io
- Gists
- Keyboard Shortcuts
- Closing Issues with Commits
- Checking out Pull Requests
- Cross-Link Issues
- Syntax Highlighting in Markdown Files
- Commit History by Author
- Empty Commits
- Comparing Branches
- Line Highlighting in Repos
- Emojis
- Images/GIFs
- Quick Quoting
- Styled Git Status
- Styled Git Log
- Git Query
- Merged Branches
- Quick Licensing
- TODO Lists
- .gitconfig Recommendations
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
To move to the previous directory in the command line:
$ cd -
Similarly, to move to the last branch in git:
$ git checkout -
# Switched to branch 'master'
$ git checkout -
# Switched to branch 'next'
git.io is a simple URL shortener for GitHub.
< 8000 div class="markdown-heading" dir="auto">