GitHub Tricks - Notes from Aloha Ruby Conf 2012 - Zach Holman

GitHub Tricks - Notes from Aloha Ruby Conf 2012 - Zach Holman

I didn’t attend the Aloha Ruby Conf but I did get to see a great video on some tips and tricks on using GitHub and Git.
http://www.youtube.com/watch?v=Foz9yvMkvlA&hd=1

http://confreaks.com/videos/1229-aloharuby2012-git-and-github-secrets

Instead of you having to watch the video I took some notes for us all, enjoy!

  • Add .diff or .patch to any Compare View, Pull Request or Commit Page.
  • Remove whitespace by adding ?w=1 to any diff URL to truncate whitespace
  • Git repo on GitHub is also a svn repository
    • svn checkout guthub.com/holman/boom
  • HTTP & SSH, HTTP is now the default vs SSH being the default.
    • git push origin master  – asks for your password
    • if you click ssh it will save your selection forever.
  • You can clone without the .git at the end, works fine.
    git clone https://github.com/holman/boom.git
    git clone https://github.com/holman/boom
  • GitHub HD’s icon set is SUPER-ZOOMABLE (retina graphics)
  • Security  http://github.com/settings/security
    • Public Keys listed
    • Repositories listed
  • Octocat started as an istockphotos image now they own the rights to it and dress it up funny 🙂
  • git.io is a url shortener:   gitio <url> <name>
  • They have a mac app and a windows app.
  • Linguist is pretty cool
  • Reply to any email and it gets added to issue comments
  • Abusing Gist – github:gist
    • using gist for css
    • gists are full repos: public clone url:  git://gist.github.com/2720312.git
    • http://git.io/mini  – quick disposable projects
    • Image View Modes – compare image versions and swipe between versions.
  • Command Line GitHub
    • brew install hub
    • fancy cloning:  hub clone holman/boom
    • multi-remote pushes:  hub push origin,staging
    • attach a pull request to an issue: hub pull-request -i <ISSUE>
    • aliasing:  alias git=hub
    • http://www.github.com/defunkt/hub
  • 404 error pages has accelerometer support 🙂
  • keyboard shortcuts
    • T – keyboard finder  (like command t in textmate)
    • W – branch selector
    • S – quick search
    • ? – all commands listed
  • Subscribe people to an issue
    • /cc @username @username @username
      • mentioned users get subscribed to all subsiquent issues
    • @ORG/TEAM will mention a team directly
    • mention SHA they autolink
    • autolinked cross-repo shaws  USER@sha1 USER/REPO@SHA1
      • #19292  to autolink to an issue
      • USER/REPO#19292
  • Fenced code highlighting in readmes
    • ` ` ` php   (three backticks no spaces in between then the language you want to use) this specifies a language inline for this block.
    •  close it with ` ` `   (three backticks no spaces in between)
  • Auto-closing an issue
    • use anything like closes, closed or even close #92827
    • fixes fixed fix #82847  works too
  • Commits by author
    • http://github.com/play/play/commits.master
    • http://github.com/play/play/commits.master?author=holman
    • http://github.com/play/play/commits.master?author=zach@holman.com
  • Pulls needn’t be from a fork
    • branch to branch pull requests
  • Pull requests use screenshots
    • ![title](http://example.com/images.png)
    • all images are cached.
  • Convert issues to pull requests
    • POST /repos/:user/:repo/pulls
  • emoji
    • :emoj:
    • examples:   :shipit: :+1: :-1:  :heard: :fire: :rage2: :shit:
    • http://www.emoji-cheat-sheet.com
  • Line linking
    • select a range by adding a – and the ending number in the url:   #L16-25
  • Advanced compare view
    • http://www.github.com/user/repo/compare/{range}
    • {range} mater…branch
    • MASTER@{1.day.ago}…MASTER
    • MASTER@{yesterday}…MASTER
    • MASTER@{2012-02-25}…MASTER