Skip to content

Instantly share code, notes, and snippets.

@valeth
Last active December 1, 2017 10:07
Show Gist options
  • Select an option

  • Save valeth/92f7f4d371403a758057c0864714fddb to your computer and use it in GitHub Desktop.

Select an option

Save valeth/92f7f4d371403a758057c0864714fddb to your computer and use it in GitHub Desktop.
Git Rebase Workflow

Git Rebase-based Workflow

  • Keeps your project more organized by splitting features into separate branches for review.
  • Avoids merge commits and keep your git history clean.

Repeat this process for every feature you want to add.

  1. Make sure the master branch of your fork is even with upstream/master
  2. Create a feature branch, leave the master branch untouched (important!)
  3. Make your changes in your feature branch
  4. Create a PR/MR to upstream
    1. Review changes in PR/MR
    2. Choose rebase merging as merging strategy (can be set in GH repository configuration)
  5. Delete the feature branch (optional)

Note:

If the feature takes a while to develop it's quite likely that it will diverge from master. So rebase the feature branch to upstream/master on a regular basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment