BlogsShopifyGit Workflow and Best Practices

Git Workflow and Best Practices

Git Workflow and Best Practices

3
posts
2011–2022

Shopify has evolved its Git workflows and best practices, with this post detailing the importance of Pull Request (PR) discipline. It emphasizes structuring PRs effectively by focusing on PR titles, summaries, and commits to enhance code review, implementation, and maintenance. This builds upon previous efforts to improve the safety and speed of merging code into the main branch, such as the upgrade of the Merge Queue system.

2022

On the Importance of Pull Request Discipline - Shopify

10/13/2022

This post details the importance of Pull Request (PR) discipline, focusing on the structure and content of PR titles, summaries, and commits. It explains how well-crafted PRs improve code review, implementation, and long-term maintenance by providing clear context and justification for changes. The post outlines best practices for writing effective PR titles and summaries, and emphasizes the role of commit messages in explaining the 'why' behind code changes.

2019

Successfully Merging the Work of 1000+ Developers - Shopify

11/14/2019

This post details the development of Merge Queue v2, an upgrade to Shopify's system for managing code merges into the main branch. Key technical contributions include: replacing the browser extension with a comment-based interface (`/shipit` command), integrating with GitHub's GraphQL API for reactions and branch protection, implementing a 'predictive branch' strategy for running CI before merging, developing a reconciliation algorithm to manage the predictive branch state, and introducing a failure-tolerance threshold to handle flaky tests. The post also discusses batching pull requests into deployable units (batch size of 8) to optimize throughput and risk.

2011

How we use git at Shopify - Shopify

8/24/2011

This post details a specific Git workflow used at Shopify, including repository forking, feature branch usage, remote setup (origin, mainline), and branch management (production, staging, master). It explains daily usage patterns for updating feature branches, pushing to staging, and merging into master and production. It also provides tips on rebasing for cleaner history, squashing commits, unstaging, amending, reverting, and bisecting.