Skip to content

Instantly share code, notes, and snippets.

@savyounts
Created March 11, 2019 20:20
Show Gist options
  • Save savyounts/ffe0fe80c87acc690663a09ab2dd4ae5 to your computer and use it in GitHub Desktop.
Save savyounts/ffe0fe80c87acc690663a09ab2dd4ae5 to your computer and use it in GitHub Desktop.
Rebasing branches
https://stackoverflow.com/questions/14893399/rebase-feature-branch-onto-another-feature-branch
https://jeffkreeftmeijer.com/git-rebase/
You can use a git rebase to add code from one brach to another to update the base it started from. So if you have two branches
you are working on, but then later realize you need the code from one branch in order to finish the other branch you can add it
by rebasing.
first make sure both files are staged and commited.
checkout the branch that you want to add to
then use git rebase other_branch
git checkout Branch2
git rebase Branch1
This adds the code from Branch1 to Branch2. At this point you don't need to keep Branch 1 and could delete if you choose to.
If you run into any errors, you can go in and fix them (they may be shown to you within atom), then
git add .
git rebase --continue
Keep doing this until you have solved all your conflicts. If it is a conflict with your main CSS file, you may need to rebuild
it and then use git add .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment