100% found this document useful (1 vote)
122 views

Github Github Github

Uploaded by

djfaweifj weijf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
122 views

Github Github Github

Uploaded by

djfaweifj weijf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 112

how

uses
i l d
github
zach holman
to b u
to b
how
uses
u i l d x
github
how github
uses github
to build github
how
uses github
to build
how
uses github
to build
how your company
uses github
to build your product
@holman
we work
asynchronously
WORKING ASYNCHRONOUSLY:
YOU CAN DO SHIT WITHOUT NEEDING TO
PULL ME OUT OF THE ZONE™.
NO MEETINGS • NO DEADLINES • NO MANAGERS
CHATROOMS
NO PRESENCE NEEDED

LOG ALL THE THINGS


EVERYONE ON THE SAME PAGE

TIME FLEXIBILITY
WORK WHEN YOU WANT TO WORK
HOW GITHUB WORKS
zachholman.com/posts/how-github-works
OKAY LET’S TALK ABOUT
PULL REQUESTS + BRANCHING
ISSUES
OAUTH AS IDENTITY
HOOKS & HUBOT
SECRETS
pull requests
+ branching
Y’all got some weird branches.
master
deploy-62
deploy-63
deploy-63b
? deploy-
REPOSITORY

ʘ‿ʘ ಠ_ಠ
TRUSTED SHITTY
DEVELOPERS DEVELOPERS

FORK FORK FORK


Keep your branches simple.
How GitHub does branching:
MASTER

BRANCH
Everyone can push, everyone can deploy.
Frees up your time from
micromanaging someone else’s code.
Master is always deployable.
Master is always deployable. We deploy
10-40 times a day.
If you’re nervous, deploy to staging.
Or deploy a branch. Or deploy to a subset
of our production boxes.

TWITTER-DRIVEN DEVELOPMENT
CHECK TWITTER, SEE IF YOU BONED A DEPLOY
Keep your branches simple.
ಠ_ಠ
What about code quality?
REQUESTS
PULL

OOH! FUTUR
ISTIC!
Pull Requests are our code review.
DISCUSSIONS DISCUSSIONS DISCUSSIONS DISCUS
DISCUSSIONS DISCUSSIONS DISCUSSIONS DISCUS
DISCUSSIONS DISCUSSIONS DISCUSSIONS DISCUS
DISCUSSIONS DISCUSSIONS DISCUSSIONS DISCUS
DISCUSSIONS DISCUSSIONS DISCUSSIONS DISCUS
WHAT
ARE PULL REQUESTS?
DISCUSSIONS DISCUSSIONS DISCUSSIONS DISCUS
DISCUSSIONS DISCUSSIONS DISCUSSIONS DISCUS
DISCUSSIONS DISCUSSIONS DISCUSSIONS DISCUS
DISCUSSIONS DISCUSSIONS DISCUSSIONS DISCUS
CODE DISCUSSION
FEATURE DISCUSSION
STRATEGY DISCUSSION

A PULL REQUEST IS A DISCUSSION


CODE DISCUSSION
FEATURE DISCUSSION
STRATEGY DISCUSSION
STRATEGY DISCUSSION
FEATURE DISCUSSION
CODE DISCUSSION

REFERENCE ISSUES
REVIEW CODE DIFFS
WRITE CODE COMMENTS
ALL
ON
A BR
STRATEGY DISCUSSION
FEATURE DISCUSSION
CODE DISCUSSION
ANC
H
REFERENCE ISSUES
REVIEW CODE DIFFS
WRITE CODE COMMENTS
TITLE OF THE PULL REQUEST

DESCRIPTION
COMMIT COMMIT COMMIT COMMIT COMMIT COMMIT COMMIT
COMMIT COMMIT COMMIT COMMIT COMMIT COMMIT COMMIT
COMMIT COMMIT COMMIT COMMIT COMMIT COMMIT COMMIT
COMMIT COMMIT COMMIT COMMIT COMMIT COMMIT COMMIT
DISCUSS DISCUSS DISCUSS DISCUSS DISCUSS
DISCUSS DISCUSS DISCUSS DISCUSS DISCUSS
COMMIT COMMIT COMMIT COMMIT COMMIT COMMIT COMMIT
talk about changes
show all commits
show specific code changes
MASTER

BRANCH
MASTER
PULL REQUEST
BRANCH
BIG S
ECRE
T #1
PULL REQUESTS:
YOU DON’T NEED
TO FORK ANYTHING.
4
WHY PULL REQUESTS ARE RAD:

REASONS
WHY PULL REQUESTS ARE RAD: ASYNCHRONOUS

No meetings.
WHY PULL REQUESTS ARE RAD: NOTIFICATIONS

Email is your interface.


WHY PULL REQUESTS ARE RAD: ACCESSIBLE

Designers can evolve mockups


and entire workflows.
Non-technical staff can add
their two cents.
WHY PULL REQUESTS ARE RAD: HISTORICAL

Pull Requests can be experiments.

Try something out, throw it


away, retain a history.
GitHub’s Pull Requests
Realtime™ status.github.com real-time polling

git (ssh): true


git (http): true
git (git://): true SUDDENLY,
downloads: true
pages: true a design
svn: true
Realtime™ status.github.com real-time polling

MIX YOUR DESIGNERS + DEVELOPERS


POST SCREENSHOTS (AND .GIFs!)
CodeMirror syntax highlighting as you type
CodeMirror syntax highlighting as you type

PULL REQUESTS ARE CHEAP AS HELL


DON’T BE AFRAID TO TOSS IT ALL AWAY
Don’t be afraid to
try to (gently) break GitHub.

{ 8 months,
couple hundred commits,
dozens of mockups
Pull Requests are
about getting shit done
without wasting a lot of time.
Can your workflow be improved?
Do you really need all that process?
PULL
REQU
EST
RECA
P

USE PULL REQUESTS MORE


SPEND LESS TIME AVOIDING SHIPPING
we have issues
where am i anyway
rich media things
more priorities priorities wat
redundant

just trolling us now


estimates
deadlines
Can you survive on
SIMPLER
tools?
Can you work faster on
SIMPLER
tools?
Can you work better on
SIMPLER
tools?
Merlin Mann
@hotdogsladies
on email priorities :
“ A priority is observed, not
manufactured or assigned.

Otherwise, it's necessarily not


a priority.
“ Making something a BIG RED TOP TOP
BIG HIGHEST #1 PRIORITY changes
nothing but text styling.

If it were really important, it'd


already be done. Period.
PRIORITIES ESTIMATES
ASSIGNEES DEADLINES
Resist adding meta-work. It gets in
the way of doing real work. (The real
work will get done anyway.)
3We use Issues for three things.
shit, something is broken
hey, this could be cool
todo lists
Do you need more than that?
Think about it.
Most of the time, you don’t.
ISSU
ES R
ECAP

SIMPLE TOOLS
MEANS MORE TIME BUILDING
YOUR PRODUCT
oauth as identity
RUBY IS SO FAST

FUCK
I LOVE IT
SO MUCH

~/Development/SECRETARYOFLABOR
was super hammered when I wrote this
single LABOR.RB web app
self-referential symlink `what`
~/Development/unmarked_van
an app that stalks people’s locations
~/Development/trace
real-time stats graphing
internal ios licensing + haystack

30
talk videos provisioning exceptions

internal app collectd


distribution graphs

INTERNAL APPS
continuous internal arbitrary
integration twitter data store
Outsiders are
not welcome.
GitHub as Authentication
TEAMS, ORGANIZATIONS, AND USERS
GitHub as Authentication
USE OAUTH TO AUTHENTICATE USERS
github.com/atmos/sinatra_auth_github

github_organization_access?('github')
# => true
GitHub as Authentication
SECURITY • CONSISTENCY • COOLICTY
OAU
TH RE
CAP

DON’T REINVENT THE WHEEL


YOUR AUTHENTICATION CAN BE FREE
hooks & hubot
B OT F I REB OT

U
MP
A
H LY C
I END
R FR
O U
OVER 300 COMMANDS, LIKE...
• deploy every GitHub app
• run branch-level tests
• play music in the office
• tell us who is in the office
• dynamically build usage graphs
• send and receive text messages
• mustache every image posted in chat
• track who swears each day
• rank by twitter followers
• ...and way, way more
L J K
LO
Hubot is not open source.
github.com/github/hubot
bots ♥ github: know your branch status
Zach
hubot what hasn’t been deployed?

Hubot
Zach: Here's what hasn't been deployed on master yet:
https://github.com/github/github/compare/{sha}...master
bots ♥ github: know your branch status
Zach
hubot what hasn’t been deployed on issues2?

Hubot
Zach: Here's what hasn't been deployed on issues2 yet:
https://github.com/github/github/compare/{sha}...issues2
bots ♥ github: know your branch status
Zach
hubot what hasn’t been deployed on issues2?

Hubot
Zach: Here's what hasn't been deployed on issues2 yet:
https://github.com/github/github/compare/{sha}...issues2
bots ♥ github: know your branch status
Zach
hubot what hasn’t been deployed on issues2?

Hubot
Zach: Here's what hasn't been deployed on issues2 yet:
https://github.com/github/github/compare/{sha}...issues2
bots ♥ github: know your branch status

https://github.com/site/sha
#=> 2c8c2e9932d0caceecd3ed8ee2adcda0ece3e564
bots ♥ github: using the API
Zach
hubot what are the pulls on holman/boom?

Hubot
HTTParty should only be a soft dependency
(master...jimmycuadra:soft-dependency) by jimmycuadra
https://github.com/holman/boom/pull/46
boom roulette (master...culvr:master) by culvr
https://github.com/holman/boom/pull/43
bots ♥ github: using the API
Zach
hubot how many issues did we close today for github/github?

Hubot
13 issues closed on github/github in the past 24 hours.
bots ♥ github

What does your company do over and over again?


Can you automate that?
HUB
OT R
ECAP

HUBOT KNOWS WHERE YOU LIVE


DO NOT TRUST HIM
everyone has
secrets
WE TUCK STUFF AWAY SOMETIMES. OOPS.
EMOJI
WORDS ARE FOR ACADEMICS, BRO

:heart: :+1: :shipit:

...and so much more: http://git.io/dmWZWg


SHORTCUTS
QUIT MAKING ME DO THINGS ALL SLOW-LIKE
w t ?
IMAGES
EVERYTHING IS BETTER WITH PIXELS
![title](url)
DIFF+PATCH
GOD I HATE PIXELS JUST GIVE ME TEXT

.diff + .patch
after most URLs
FENCED CODE
IT’S LIKE CODE BUT WITH MORE FENCES

require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
FENCED CODE
IT’S LIKE CODE BUT WITH MORE FENCES
```ruby
require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
```
FENCED CODE
IT’S LIKE CODE BUT WITH MORE FENCES

require 'redcarpet'
markdown = Redcarpet.new("Hello World!")
puts markdown.to_html
MENTIONS
GET SOMEONE ELSE TO DO YOUR WORK
pull requests
@username issues
commits
WHITESPACE
IT SUCKS

?w=1
add

to URLs
REPO REFERENCES
AROUND THE REPO, AROUND THE REPO, AROUND

user/repo#issue
GIT.IO
OFFICIAL LAUNCH ANNOUNCEMENT
https://github.com/holman/really-
fucking-long-url-wtf-is-u-doing

git.io/url
GIT.IO
OFFICIAL LAUNCH ANNOUNCEMENT

curl -i http://git.io -F 'url=#{url}' #{code}


http://git.io/nxVVig
THE
BIG R
ECAP

SIMPLE BETTER AWESOME


TOOLS + PROCESS = PRODUCT
thanks!
zach holman
zachholman.com/talks
twitter+github: @holman

You might also like