Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pick Your Git Branching Strategy

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

Pick Your Git Branching Strategy

When working out the best strategy for your team, there are a few key questions that will influence your decision. This session runs through and gives advice on how to put together a workflow that works for your particular scenario

Avatar for Lorna Mitchell

Lorna Mitchell

October 29, 2015
Tweet

More Decks by Lorna Mitchell

Other Decks in Technology

Transcript

  1. A Branch is a Label Take a look in .git/refs/heads/

    • A branch is a pointer to a commit. • You commit on a branch, the commit is created and the pointer updated.
  2. Sample Branching Strategies • Git Flow: http://lrnja.net/1ebawKU • GitHub Flow:

    http://lrnja.net/1Gr29Jn • Atlassian blog: http://lrnja.net/1BSFQcQ • Docs from GitLab: http://lrnja.net/1AiPxQJ Some common elements between these
  3. Branch Naming • master default branch name • develop often

    used for bleeding edge branch Configure your repo accordingly
  4. Hotfix Pattern Branch off, commit once, merge with --no-ff •

    makes it very clear what happened • easily merge the branch back upstream if needed • makes it possible to cleanly undo without losing anything
  5. Environment Branches Maintain one branch per platform • branch always

    reflects current state of platform • plays well with automated deployment
  6. Tagging for Releases Git has two types of tags: •

    simple tags are just a label, like a branch that doesn't advance • annotated tags are an object, they can contain messages git tag -a v2.11 -m "v2.11 with caching" Then push the tag