Behind the Scenes

Shopify’s on Fast Company’s “The World’s 50 Most Innovative Companies” List! / You Should Work With Us

Shopify Makes Fast Company’s “50 Most Innovative Companies” List We’re in good company: along with Amazon, Square and…

Shopify Makes Fast Company’s “50 Most Innovative Companies” List

Fast Company / The World's 50 Most Innovative Companies - featuring Shopify

We’re in good company: along with Amazon, Square and Patagonia, Shopify made Fast Company’s “World’s 50 Most Innovative Companies” list in the “Retail” category. Here’s what they wrote:

For democratizing and automating ecommerce tools. Shopify offers pre-made templates that allow people to quickly and easily set up an online store without needing to know how to code a website. Shopify creates tools and templates to power online storefronts. (Notable clients include Rovio, Angry Birds’ parent company, and GE.) Shopify has grown to almost 20,000 storefronts in 88 countries, which did a combined $275 million in online sales, up from $120 million in 2010. Up next: Making it as easy to buy sell to mobile customers.

Join Us, It’s Bliss!

Shopify standard issue gear: Apple 27" display, MacBook Pro, Apple Wireless Keyboard, Aeron chair, Apple Magic Mouse, Bag O' Stuff

Even more Shopify standard issue gear: Light grey Shopify t-shirt, dark grey Shopify t-shirt, light grey Shopify hoodie, neat pen, Moleskine notebook, Godiva chocolates, $100 restaurant gift card, $50 Apple Store gift card

If making the Fast Company list doesn’t impress you, maybe my earlier article about why Shopify’s a great place to work will. From the company’s success to interesting projects to the way we get stuff done to the cool gear that’s standard issue for Shopify employees (see the photo above; you get to pick between a MacBook Pro and MacBook Air these days), there are reasons aplenty to hitch your wagon to Shopify’s star.

We’re looking to fill these positions right now:

Software Engineer, Applications
Ottawa, Ontario, Canada

Shopify is looking to hire a Software Engineer for our growing Applications Team. The Applications Team is responsible for building supported Shopify Applications for the Shopify App Store as well as 3rd party applications. If you are interested in working on challenging Ruby on Rails projects with a team of highly motivated and talented individuals then this position is for you.

Software Engineer, Billing
Ottawa, Ontario, Canada

Shopify is looking to hire a Software Engineer to maintain and extend our sophisticated SaaS billing platform servicing over 20,000 merchants. The Shopify billing system is a core piece of infrastructure that handles millions of dollars of financial transactions. If you are interested in working on challenging Ruby projects with a team of highly motivated and talented individuals then this position is for you.

[ This article also appears in Global Nerdy. ]

Looking For a Job at Shopify? Come to Ruby Job Fair 2012 and Talk to Me!

Ruby Job Fair 2012: This Friday, February 10th The Ruby Job Fair isn’t your father’s (or mother’s) job…

Ruby Job Fair 2012: This Friday, February 10th

Poster for Ruby Job Fair: Friday, February 10th, 6 - 9 p.m., Unspace HQ, 342 Queen Street West, floor 3, Toronto, Ontario.

The Ruby Job Fair isn’t your father’s (or mother’s) job fair. And why would it be? After all, it’s an event put on by Meghann and the other fine folks at Unspace, the development shop that gave the world the mind-blowingly amazing RubyFringe and FutureRuby conferences.

You may have heard or learned from painful experience that job fairs are like this:

A traditional job fair: a gym with stations made of folding tables with prospective employers at each one. It looks like bureaucratic Hell on Earth.

Unspace’s gatherings are a little more like this:

The bar at an Unspace tech gathering, with people enjoying their converation and drinks. It looks like a cocktail party!

A party crowd in Unspace's back room enjoying their drinks and conversation. A pinball machine is in the background.

The two photos above were taken at an event that they threw called Technologic, which took the typical evening tech seminar on its ear. You can read more about it in my blog entry about that event.

If you’re looking for work that involves Ruby programming and you’re going to be in downtown Toronto on Friday, you should register to attend the Ruby Job Fair. It’ll be your chance to meet prospective Ruby employers and their representatives, which will include me – I’ll be there as the Shopify Guy. You won’t be able to miss me: I’ll be the one with the accordion…

Joey deVilla works on his Macbook Pro, with his accordion and a glass of whiskey by his side.

The quick details about Ruby Job Fair:

  • Date: Friday, February 10, 2012
  • Time: 6:00 p.m. – 9:00 p.m.. Do not show up early. They’ve got work to do.
  • Place: Unspace HQ, 342 Queen Street West, just a bit east of Spadina, beside the Lululemon store.
  • Registration fee: $5 for job-seekers, $15 for employers seeking job-seekers. You need to register to attend.
  • Other details: See the registration site and read the notes carefully!

Why Work at Shopify: The Hard-Nosed, Pragmatic Business Reasons

Shopify Logo

Normally, I’d start with a description of Shopify’s hacker ethic, how it’s a great-yet-casual work environment, that everyone gets a MacBook Pro or MacBook Air as their work machine, that  and how fun and rewarding it is to work there. That’s all true, but I’m sure every software development shop has a spiel along the same lines. So I’ll give you that spiel later. How ‘bout I answer the question that might be lingering somewhere in your mind: “Are you guys still going to be around a year from now, or are you going to crash and burn and leave me looking for work again?”

ecommerce-chart-2q11_large

For starters, we’re in the ecommerce business, and business is good. How good? In the second quarter of 2011 – remember, that’s only April, May and June – ecommerce sales in the U.S. were $48 billion. And impressive as that figure may be, ecommerce is still less than 5% of all retail.

Ecommerce is growing too, and it’s becoming a bigger and bigger part of how people buy and sell things; in fact, ecommerce sales are growing at over twice the rate of all retail.

11,300 shops in 2010, 18,200 shops in 2012 - up 61%. $125M in sales in 2010, $275M in 2011 - up 2 1/2 times.

Going from ecommerce in general to Shopify in particular, things are looking great there too. We went from 11,000 to 18,000 shops in 2011, and as of this writing, we’ve crossed the 20,000 mark. The 2010 total sales from all our shops was $125 million, and we more than doubled that last year, moving $275 million in products.

Cat sitting on a pile of money

On top of being a profitable business, we also have had two rounds of funding, which gave us a grand total of $22 million invested in us. That money’s being used to grow the company in all sorts of ways, from the Shopify Fund to things like our recent acquisition of Select Start Studios, a mobile dev company.

Why Work at Shopify: The “I Want to Work Someplace Cool” Reasons

Here’s what was waiting for me at my desk on my first day at Shopify. I felt like a kid in a candy store:

15" MacBook Pro, Apple Wireless Keyboard, Aeron chair, Apple Magic Mouse, Bag o' Stuff, Apple 27-inch display

Light grey Shopify T-shirt, dark grey Shopify T-shirt, light grey Shopify hoodie, $100 restaurant gift card, $50 Apple Store gift card, Godiva chocolates, Moleskine notebook, neat pen

We want to do good work, and good work needs good tools.

Good work needs a good physical environment, and we’ve got that in spades. Check out our brand-new office. Here’s the reception desk, which is occupied by Laura, our gets-stuff-done-so-we-can-get-stuff-done person:

shopify office 1

We believe that small, agile teams work best, so we’ve broken our space into offices just like the one below, and each team is free to set up and decorate their space as they see fit. They’re not normally this crowded; the photo below is from the party we had on Friday:

shopify office 2

I’m in the developer advocate/evangelism group, and we went with this pop art wall covering in our zone:

shopify office 3

Others on our team have some great illustration talents and put them to good use:

shopify office 3a

Sure, we’ve got your standard meeting rooms (and they’re pretty nice for what they are):

shopify office 4

…but one of them’s equipped with an Xbox and Kinect:

shopify office 11

And then there are little gems like this room:

shopify office 5

shopify office 9

It’s the 8-bit paradise. I spent an afternoon working on API docs in the room, a nice quiet space where you can concentrate, after which you can reward yourself with classic 1980s console action!

shopify office 6

This poster was created by our design team, a very talented bunch:

shopify office 7

We’ve got a fine collection of vintage cartridges:

shopify office 8

Ah, the Atari 2600. It takes me back to my wonderfully misspent youth:

shopify office 10

Why Work at Shopify: The “I Want to Draw the Owl” Reasons

shopify-apps-team-meeting

One of the reasons that Shopify is successful is that we’ve worked out some ways of doing things. We’re all about “drawing the owl”, and the way we do things is an in the service of drawing that owl. (Don’t worry, you’ll soon know what “drawing the owl means”.)

Shopifolks – that’s what I like to call people at Shopify – are self-starters. Once given a goal, they use their skills, knowledge and good judgement to do the work necessary to hit that goal. They get stuff done. They’re what Y Combinator’s Paul Graham calls “resourceful”.

I recently wrote about how my team (and pretty much every other team at Shopify) gets things done, but it’s worth repeating:

  • Act like an owner. You don’t "just work here", you own a piece of a company and have a stake in its success. Work as if your livelihood, career and reputation were riding on it, because as an owner, it is! Be entrepreneurial and own your domain: if you have an idea and it lines up with the company’s goals, make that idea happen.
  • Know what to work on and what things to ship. While owners have the freedom to work on and ship whatever they like, they also work in the real world. 80% of what makes the company go is often achieved by doing the most important work first, which typically makes up 20% of the available tasks. Sometimes these tasks can be tedious and feel like drudgery, but if they’re what makes things happen for our customers and their customers, they’ve got to be done, and with the highest priority.
  • Done is better than perfect, or "the best" is the enemy of "the good".Perfectionism is a form of procrastination. It assumes that time is an infinite resource, that other tasks can wait while you add "just one more touch" and that "perfect" is attainable. You have to be able to make the call and say "done" at some point. A good feature that our customers use and enjoy is infinitely better than a perfect one that "will be available soon". As they say at Apple, "Real artists ship".
  • Have high standards. While done is better than perfect, good still remains better than bad.
  • It’s okay to fail; just fail gracefully. The only sure-fire way to not fail is to not do anything. Since we can’t do that and remain in business, never mind take the company to the heights we want to, we have to accept failure as part and parcel of trying. Sometimes we’ll make mistakes, other times we’ll do things right and still our best-laid plans won’t work because of circumstances outside our control. The trick is to learn from failure and make sure our failures aren’t fatal. As our CEO Tobi likes to say: "If I’m not failing every now and again, I’m not trying hard enough."
  • Communicate good news quickly, communicate bad news ever more so. The first part is easy: it takes no effort to tell the team your project is a success. It’s a good thing to do so; good news bolsters the team and success often breeds more success. However, a combination of pride and fear (and in some companies, a "cover your ass" culture) makes it difficult to tell the team that you’re having trouble or that something’s not working out. It’s best to tackle problems as soon as possible, while they’re still small and manageable, and the best way to do this is to communicate bad news as quickly as possible — remember, it’s okay to fail.
  • Understand and respect the makers’ and managers’ schedules. As Paul Graham wrote in his essay, Maker’s Schedule, Manager’s Schedule, makers and managers operate by different schedules. Managers’ days are determined by their appointment calendars, which divide the days into hours and even half-hours, and things like meetings fit into the manager’s schedule easily. Makers, on the other hand, do things in half-day or even full-days blocks, and things like meetings are disruptive. Some of the team operate on a maker’s schedule, other operate on a manager’s schedule, and many of us switch between the two, depending on what day it is and what tasks they have on that day. Know who operates on which schedule (and when), and understand and respect those schedules.
  • Operate lean and mean. We’re made up of multi-talented, capable, autonomous, ambitious go-getters, and that means we don’t have to operate like a big, lumbering beast. Unless the circumstances are unusual, there really should be 2 people maximum per deal or project. Meetings and calls should be kept to 30 minutes or less, not counting brainstorming or design pow-wows. And full-on meetings aren’t always necessary: you should be able to "just pop by" anyone’s office or desk or call them up on Skype.
  • Update often. Because we operate lean, means and independently, communication is vital. Keep your teammates apprised of your progress! 
  • Draw the owl. In the end, that’s what you’re trying to do…

draw the owl

Think You Can Work at Shopify? See Me at Ruby Job Fair.

If Shopify looks like the sort of place where you’d like to work, and if you think you’ve got the skills, enthusiasm and passion to work with us, come see at Ruby Job Fair. I’d be happy to answer all your questions and hook you up!

[ This article also appears in Global Nerdy. ]

How the Apps Team Gets Things Done

  Pictured above is the team at Shopify to which I belong. It's the Apps Team, and while…

 

Pictured above is the team at Shopify to which I belong. It's the Apps Team, and while it may be small, it takes on the company's most ambitious projects: the Shopify App Store, Shopify Experts, Shopify Partners and Shopify Fund as well as the company's business development and developer advocacy efforts. It's our team's job to take the Shopify platform and see how far we can take it.

As a small team charged with a lot of responsibilities, we have to do things in a way that maximize the effect our actions have. Over the past year, we've worked out a number of ways of doing this, some gained from experience, others from experimentation. They've remained what's called "tacit knowledge" -- practiced by the team but not written down or formally codified in an operations manual -- until team leader Harley Finkelstein, our Chief Platform Officer, collected them into a set of slides.

The way we get things done boils down to the general principles listed below. Your team may not be like ours, but I'm sharing these principles because you might find at least some of them useful:

  • Act like an owner. You don't "just work here", you own a piece of a company and have a stake in its success. Work as if your livelihood, career and reputation were riding on it, because as an owner, it is! Be entrepreneurial and own your domain: if you have an idea and it lines up with the company's goals, make that idea happen.
  • Know what to work on and what things to ship. While owners have the freedom to work on and ship whatever they like, they also work in the real world. 80% of what makes the company go is often achieved by doing the most important work first, which typically makes up 20% of the available tasks. Sometimes these tasks can be tedious and feel like drudgery, but if they're what makes things happen for our customers and their customers, they've got to be done, and with the highest priority.
  • Done is better than perfect, or "the best" is the enemy of "the good". Perfectionism is a form of procrastination. It assumes that time is an infinite resource, that other tasks can wait while you add "just one more touch" and that "perfect" is attainable. You have to be able to make the call and say "done" at some point. A good feature that our customers use and enjoy is infinitely better than a perfect one that "will be available soon". As they say at Apple, "Real artists ship".
  • Have high standards. While done is better than perfect, good still remains better than bad.
  • It's okay to fail; just fail gracefully. The only sure-fire way to not fail is to not do anything. Since we can't do that and remain in business, never mind take the company to the heights we want to, we have to accept failure as part and parcel of trying. Sometimes we'll make mistakes, other times we'll do things right and still our best-laid plans won't work because of circumstances outside our control. The trick is to learn from failure and make sure our failures aren't fatal. As our CEO Tobi likes to say: "If I'm not failing every now and again, I'm not trying hard enough."
  • Communicate good news quickly, communicate bad news ever more so. The first part is easy: it takes no effort to tell the team your project is a success. It's a good thing to do so; good news bolsters the team and success often breeds more success. However, a combination of pride and fear (and in some companies, a "cover your ass" culture) makes it difficult to tell the team that you're having trouble or that something's not working out. It's best to tackle problems as soon as possible, while they're still small and manageable, and the best way to do this is to communicate bad news as quickly as possible -- remember, it's okay to fail.
  • Understand and respect the makers' and managers' schedules. As Paul Graham wrote in his essay, Maker's Schedule, Manager's Schedule, makers and managers operate by different schedules. Managers' days are determined by their appointment calendars, which divide the days into hours and even half-hours, and things like meetings fit into the manager's schedule easily. Makers, on the other hand, do things in half-day or even full-days blocks, and things like meetings are disruptive. Some of the team operate on a maker's schedule, other operate on a manager's schedule, and many of us switch between the two, depending on what day it is and what tasks they have on that day. Know who operates on which schedule (and when), and understand and respect those schedules.
  • Operate lean and mean. We're made up of multi-talented, capable, autonomous, ambitious go-getters, and that means we don't have to operate like a big, lumbering beast. Unless the circumstances are unusual, there really should be 2 people maximum per deal or project. Meetings and calls should be kept to 30 minutes or less, not counting brainstorming or design pow-wows. And full-on meetings aren't always necessary: you should be able to "just pop by" anyone's office or desk or call them up on Skype.
  • Update often. Because we operate lean, means and independently, communication is vital. Keep your teammates apprised of your progress! 
  • Draw the owl. In the end, that's what you're trying to do...

[ This article also appears in Global Nerdy. ]

Deliberations

A little while back, we announced the Shopify Fund, a one million dollar pool of money set aside…

decisions decisions

A little while back, we announced the Shopify Fund, a one million dollar pool of money set aside to stimulate the development of Shopify apps, applications that made use of the Shopify API to extend, enhance and automate Shopify shops. We asked developers to submit their app proposals and if their app was chosen, we’d give them somewhere in the neighborhood of five to ten thousand dollars to take a few weeks to work on their app idea full-time, complete it and put it into the Shopify App Store.

million dollar fund

In the end, we received 143 app proposals – many of which were submitted on the deadline date, November 30th -- a considerable deal more than we’d expected. We’ve been spending the past couple of weeks deliberating over which apps should get funding in the Fund’s first round, in closed-room sessions not unlike the scene from 12 Angry Men shown above. We still have to have a few more discussions before we make our final choices, and we’ll announce which apps are getting funding in the new year.

If you didn’t get a chance to submit an app idea or if your app idea submission doesn’t get selected, don’t worry. This is just the first round, and we want to continue funding the development of apps through the coming months – both apps that you propose and apps that we have on our wishlist. The Fund will continue because:

  • We think it builds interest and excitement about the Shopify ecosystem. The number of responses we’ve received from the developers proposing apps seems to indicate this.
  • We want to make it possible for developers to have the time they need to build Shopify apps. By funding developers, we give them enough money so that they don’t have to take on any other clients and just work on an app full-time.
  • We want Shopify to be the ecommerce platform with the most capabilities. Shopify does a lot “out of the box”, and it does so much more when you extend it with apps. More apps means more capabilities and customizations, and we think that’s a good thing.

So keep an eye on this blog for announcements in the new year – not just about whose apps are being funded in the first round, but also for new chances for you to get funding to develop Shopify apps!

[ This article also appears in Global Nerdy. ]

Your Faithful Scribes are Working Away at Fixing the Docs

This is just a quick update to let you know that yes, we know that the Shopify developer…

Woodcutting of a scribe working on a text, with the thought bubble "WTF?"

This is just a quick update to let you know that yes, we know that the Shopify developer documentation needs work. There’s a fair bit of information there, but it could stand some improvement. There’s some missing information, it could be organized better, there are parts of it that are confusing and there need to be examples in languages and frameworks other than Ruby and Rails.

This update is also here to let you know that we’re actively working on it, bit by bit, every day. As I write this, David Underwood and are are working on a wholesale reorganization of the developer sections of the wiki and clear writeups of all the API resources, including explanations of the parameters they expect and the attributes they return as well as how they relate to other resources and what effects they have on shops. We’re also working on more example code, in more languages.

If you’ve got comments, questions and suggestions about the docs or what we’re doing with them, please let us know -- feel free to leave a comment or drop me a line.

[ This article also appears in Global Nerdy. ]

Scenes from the Shopify Meetup in Montreal

  Yesterday's Shopify meetup in Montreal was great fun, and I think it was a pretty successful meetup,…

 

Yesterday's Shopify meetup in Montreal was great fun, and I think it was a pretty successful meetup, bringing together developers who build on the Shopify platform, shopowners and some of us Shopifolks who drove down to catch the event: CTO Cody Fauser, Developer Advocate Edward Ocampo-Gooding, and Yours Truly (Joey deVilla, Platform Evangelist).


I'd like to thank Dave "@hunkybill" Lazar (the guy in the middle in the photo above) and Mitch "@meeech" Amihod (on the right in the photo above) for putting together this event at Montreal's Irish Embassy pub. Events like this are great for Shopify's users as well as the developers and designers who build on the Shopify platform; they're also good for us, because they give us a chance to get to meet up with our customers and partners face-to-face and better meet their needs.


As the evening went on, we switched venues to Montreal's legendary brewpub, Dieu de Ciel, where we continued with engaging conversations (and okay, maybe a little beer) well into the night.

Mitch and Dave seemed happy with the way this meetup went, and it's likely that there will be more. I'm working on getting similar events happening in others places -- watch this space!

Featured App: Wishpot Button

  Wishpot is a registry system that lets you create wish lists -- wedding registries, honeymoon registries, baby…

 

Wishpot is a registry system that lets you create wish lists -- wedding registries, honeymoon registries, baby registries, gift idea lists or "here's some stuff I'd like to have" lists -- any kind of list where you invite people to participate in gift-giving. Wishpot has a twist that other registry sites don't have: it's universal, and lets you include items from any store.


The Wishpot/Venpop Team.

Wishpot is a Seattle-based company with two brands: Wishpot for consumers and Venpop for business-to-business. They've been in business since 2007 building their wishlist platform for the web and in 2010, they introduced their social commerce apps space, now under the Venpop brand.

We invited them to tell us a little more about their Shopify app, Wishpot Button, its features, and how they built it.

What does Wishpot Button do?

Wishpot is the leading universal wishlist service that works with any store.  For shoppers, this means they no longer need to keep track of different wish lists at different websites.  Wishpot provides additional features to keep users engaged year-round - birthday reminders, deal alerts, cash contributions, social sharing features, ecards, and much more.  For store owners, this means less abandonment of wishlists and increased activity on items that have been added to the lists because of the engaging feature set.  This is a free service for both stores and users.

What are the key features of your app?

  • Adds a universal wish list and registry – for example baby and wedding - to your shop
  • Price alerts bring back your customers when prices change on your store
  • Cash Contributions functionality makes it easier to buy your more expensive items
  • Social sharing and ecards allow your customers to easily share their list and get your products discovered
  • Get reporting, in store support, custom branding, experts and much more with the easy upgrade to the white label version

Why should shopowners use this app?

This enables any shop owner to instantly make each product easy to add to a wish list or registry.  It is incredibly easy to install, it does not cost anything, it provides a great service to your customers, and above all drives users and potential customers back to your shop.

Where did you get the idea for your app?

We had several Shopify customers ask to integrate our services with Shopify and after a few conversations with the great guys at Shopify, so we decided it was the time to pull the trigger and start developing some great apps. The Wishpot and Venpop technologies are a perfect extension to the already fantastic Shopify experience.

How long did it take for you to build the app?

The main app was built in about a week, though we revised and simplified it over the course of several more weeks.  The hardest thing to get accustomed to up front was "where" the app runs.  Although the main Wishpot site is built in C# and .NET, we decided to build the app in Ruby and Rails on Heroku due to it's more extensive use and testing with the Shopify ecosystem.  We then needed to ask a few forum questions about the ScriptTag features, because we really wanted people to be able to install the "add to wishpot" button without having to edit a liquid template, and the scripttag feature enabled us to build that experience.  

In order to enable Venpop technologies (this is an update that's coming to the app in the next few days) we then had to add some additional features to link our .NET-based service to the Ruby-based service, which we're able to accomplish via oauth and the RESTful apis both platforms provide.  So, when a user authorizes the app, their access token is also sent back to our .NET services, so that Venpop's product feed processing engine has access to the catalog.  That way, if someone signs up for Venpop Social Commerce, we'll have access to their storefront to monitor it for changes, tweet new deals, etc.

How can we find you online?

Web: http://www.wishpot.com | http://venpop.com

Twitter: @wishpot | @venpophq

Blog: http://blogs.wishpot.com/ | http://venpop.com/category/blog/

Where can I find out more about Wishpot button?

You can find out more about Wishpot Button on its page in the Shopify App Store.

[ This article also appears in Global Nerdy. ]

How we use git at Shopify

Photo by Paul Hart A little while back, Rodrigo Flores posted to the plataformatec blog, A (successful) git branching…


Photo by Paul Hart

A little while back, Rodrigo Flores posted to the plataformatec blog, A (successful) git branching model, where he talks about the git workflow they've been using on some projects. I thought this was a great post and decided to do something similar explaining the git workflow that we use at Shopify.

Preface

Git is an incredibly powerful tool that can be used in many different ways. I don't believe there is a 'correct' workflow for using git, just many different options that work for particular situations and people. The workflow that I am going to describe won't work for everyone, and not everyone at Shopify uses git in the same way - you have to modify and massage it to shape your needs and the way you work. I don't consider myself an expert with git, but am comfortable enough with the tool to handle just about everything I might need to do. If there's anything I can't figure out, James MacAulay is our resident git expert in the office and always willing to help out.

Okay, lets get down to business.

Setup

When working on a project each developer and designer first forks the repository that they want to work on. Forking a repository is really simple, Github even has a guide if you need some help with it. A fork is basically your own copy of the repository, that you can change without affecting anyone else. We use GitHub for all of our projects so it makes managing the forks really easy. All the work is done on your fork of the repository and only gets pulled into the main repository after it has been fully tested, code reviewed, etc. We also use the concept of feature branches to make it easy to switch between tasks and to share the work with other colleagues. A branch is kind of like a fork within your own repository, you can have many branches within your forked repository for each of the tasks you're working on. Your checkout of a project should be setup with a couple of remotes and branches to get started.

Remotes:

  • origin - This is a remote pointing to your clone of the project and added by default when you do 'git clone'.
  • mainline - This is a remote pointing to the main repository for the project. We use this remote to keep up to date and push to the main repository.

Branches:

  • production - This is the production branch of the main repository (or mainline). This is the code that is ready to be deployed to production.
  • staging - Contains the code that is being run on the staging server (we have two that developers can use). Before a feature is considered 'finished' it must be tested on one of the staging servers, which mirrors the production environment.
  • master - Contains completed features that can be deployed.

So how do we set all this up? These couple of git commands should take care of it:
git clone git@github.com:jduff/project.git
git remote add mainline git@github.com:Shopify/project.git
Keeping a project up to date is also really easy, you just pull from mainline.
git checkout master
git pull --rebase mainline master
I know what you're thinking, what the heck is that 'rebase' doing in there? Well, you don't really need it, but it helps to use it in case you've merged a new feature that you haven't pushed yet. This keeps the history all tidy with the changes you made on top of what is already in master instead of creating an additional "merge" commit when there's a conflict.

Day To Day Usage

So how does all of this work day to day? Here it is, step by step:
git checkout master
git checkout -b add_awesome # Feature branches, remember
# Do some work, listen to a lightning talk, more work
git commit -m "Creating an awesome feature"
Mainline master moves pretty fast so we should keep our feature branch up to date
git checkout master
git pull --rebase mainline master

git checkout add_awesome
git rebase master
Everything is finished, test it out on staging!
git push -f mainline add_awesome:staging
# This blows away what is currently being staged, make sure staging isn't already in use!
Staging is cool...code review...high fives all around, ship it!

It's always easier to release a feature if master is up to date and you've rebased your branch. See above for how to 'keep our feature branch up to date'. We also make sure to squash all the commits down as much as possible before merging the feature into master. You can do this with the rebase command:
# Rebase the last 5 commits
git rebase -i HEAD~5
Now we can merge the feature into the master branch:
git checkout master
git merge add_awesome
git push mainline master
And if you want your code to go out to production right away you have a couple more steps:
git checkout master
git pull mainline master # Make sure you're up to date with everything

git checkout production
git merge master
git push mainline production
# Ask Ops for a deploy
That's about it. It might seem like a lot to get a hang of at the start but it really works well and keeps the main repository clear of merge commits so it's easy to read and revert if required. I personally really like the idea of feature branches and rebasing as often as possible, it makes it super easy to switch tasks and keeps merge conflicts to a minimum. I almost never have conflicts because I rebase a couple of times a day.

A Few More git Tips

I've got a couple more tips that might help you out in your day to day git usage.
# Unstage the last commit
git reset HEAD~1
git reset HEAD^ # Same as above

# Remove the last commit from history (don't do this if the commit has been pushed to a remote)
git reset --hard HEAD~1

# Interactive rebase is awesome!
git rebase -i HEAD~4
git rebase -i HEAD^^^^ # Same as above

# Change the last commit message, or add staged files to the last commit
git commit --amend

# Reverses the commit 1b9b50a if it introduced a bug
git revert 1b9b50a

# Track down a bug, HEAD is bad but 5 commits back it was good
git bisect start HEAD HEAD~5

Conclusion

So there you have it, that's how we use git at Shopify. I don't know about everyone else, but once I got going I found this workflow (particularly the feature branches) to work very well. That doesn't mean this is the only way to use git, like I said earlier it is an incredibly powerful tool and you have to find a way that works well for you and your team. I do hope that this might serve as a starting point for your own git workflow and maybe provide a little insight into how we work here at Shopify.

Our tools and the way we use them are constantly evolving so I would love to hear about how you use git to see if we might be able to improve our own workflow. Let us know in the comments or better yet, write you own blog post and drop us the link!


Start your free 30 day trial!

Create an online store in minutesTry Shopify