Skip to content

Git Merging for Dummies

Dawson Whitehead edited this page May 13, 2018 · 10 revisions

There are a few step to merge git branches. This is a quick start guide so you don't repeat my mistakes...

Quick Start Guide

Steps

  1. Run git pull --all to get the most up to date copy of all branches.

  2. Run git checkout parent_branch to switch to parent_branch.

  3. Run git merge origin/child_branch to pull child_branch into parent_branch.

  4. Run git push to update parent_branch on github.

Key

  • parent_branch: the branch that you want to merge into. This will contain both branches at the end.
  • child_branch: the branch that you want to put into parent_branch. This branch will disappear into parent_branch.

Notes

  • You can see all the branches by running git branch --all.

  • If you're lucky, you won't have any merge conflicts and the merge will happen automagically. However, if you see something mentioning conflicts, don't be alarmed. Just modify/delete the files that git had a problem with and then commit and push.

Clone this wiki locally