Docs, guidelines and compromising photos
To make changes to these pages, checkout the wego.github.io project and the GitHub Pages docs.
git checkout -b descriptively-named-branch
master
branch.After reading this page, you'll:
Ground rules and an overview of the flow:
master
branch is always deployable.master
branch. Ever. OK, OK we can make exceptions for emergencies.master
(e.g. new-maps-interface
).master
.master
, you should deploy immediately.master
branch is always deployableThis is a hard rule. The master
branch should be stable and is always safe to deploy and create new branches off of. If you push something to master that breaks something, you've broken the social contract of the development team and you should feel pretty bad about it.
Future: We don't have many automated tests, but when we do (post-Project Zero), we can rely on these tests and CI to tell us when things break.
master
branchThis is a soft rule. In cases of emergencies (e.g. www.wego.com is down because of a code error), you are allowed to break this rule. After the emergency is resolved, go back and undo any hacks you've done (following the flow described here).
When you want to start work on anything (a new feature, a bugfix, CSS tweaks, anything), you create a descriptively named branch off of the master
branch. These are some good examples: iran-country-site
, rails4-upgrade
, fix-datewise
(use hyphens instead of underscores). If there is a JIRA issue tied to the feature or bug, append the JIRA issue key like so: fix-missing-flight-schedules-FLIGHTS-88
.
A descriptive name helps a lot because you can easily see what everyone else is working on, and it's fairly easy to know what the branch is all about.
How to do this:
git checkout master
- make sure you're on the master
branch.git pull --rebase
- get the latest commits in master
, if any.git checkout -b descriptively-named-branch
- create a descriptively named branch off of master
.Now that you have your local branch, you can start committing to it. Regularly push your work to GitHub so that you have a backup, and people can see what you're working on (maybe they can help out with something).
How to do this:
git push -u origin descriptively-named-branch
- push the current branch and set the origin
remote as the upstream.git push
for future pushes.We're going to use pull requests to send a pull request from one branch to another within a single repository. The pull request then becomes more of a branch conversation where developers can use them to say "I need help", "Please review this" or "Please merge this really cool thing I did over the weekend. Love, Son".
How to do this:
git merge master
when required - if your branch has been open for too long and you feel it's getting out of sync with master
, you can merge master
into your topic branch and keep going.master
after pull request reviewWhen you feel your work is ready to be merged into master
, get it signed off by another developer (or developers - the more the better). Once you have some +1s, you can merge it into master.
Future: Most of our apps don't have tests or CI. When they do, there'll be an additional requirement before you can merge your branch: your pull request's commits should pass CI (we'll probably use Travis since it integrates into GitHub).
Finally, your work is done and merged into the master
branch. This means that if you don't deploy it now, people will base new work off of it and the next deploy will push it out. Since you really don't want someone else to push something that you wrote that breaks things, you should deploy immediately after merging your work into master
so that you can supervise and verify your changes on production.
Our current workflow of regularly committing to master
(provided that new commits passed CI) means that we always have code that we can trust as being deployable. By doing this, we enforce and encourage a few things:
The flow documented here is heavily inspired by Scott Chacon's post on GitHub Flow. Check that out, srsly - it's far more eloquent than the gibberish on this page.