Skip to content

Instantly share code, notes, and snippets.

@mattbornski
Last active December 19, 2015 14:09
Show Gist options
  • Save mattbornski/5967238 to your computer and use it in GitHub Desktop.
Save mattbornski/5967238 to your computer and use it in GitHub Desktop.
Feature branch workflow
# Create feature branch from development branch
# Let's start from the most up-to-date version
git checkout <develop-branch>
git pull
# And create a feature branch to do our work out of the way
git checkout -b <feature-branch> <develop-branch>
# And use it
git checkout <feature-branch>
# Do work here
# ...
# Periodically merge in commits from develop branch if your feature takes a while
git rebase <develop-branch>
# If conflicts arise, resolve them manually, mark them resolved using "git add" and then continue using "git rebase --continue"
# Merge feature back into development
# First make sure we've pulled in any remote changes
git checkout <develop-branch>
git pull
# Merge the feature into the development branch so everybody can use it
git merge --no-ff <feature-branch>
# Propagate the change upstream
git push origin <develop-branch>
# We no longer need the branch
git branch -d <feature-branch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment