Skip to content

Instantly share code, notes, and snippets.

@rymawby
Created June 11, 2013 13:39
Show Gist options
  • Select an option

  • Save rymawby/5756909 to your computer and use it in GitHub Desktop.

Select an option

Save rymawby/5756909 to your computer and use it in GitHub Desktop.
Git rebasing basics
# Pull often and rebase often
# branch
git checkout -b branch_name
# finished working on small piece of work
git add .
git commit -m 'Commit message'
git push origin branch_name
# pull to check if anything changed - switch to branch
git checkout branch_to_rebase
git pull
git checkout branch_name
# rebase changes
git rebase branch_to_rebase # or whatever
@rennyoh
Copy link

rennyoh commented Nov 1, 2019

see current branch

$ git branch

  • branch-a
    ...

rebase preferring current branch changes merge during conflicts

$ git rebase -Xtheirs branch-b

to avoid massive conflicts from rebasing branch-b, I would use this to user current branch-a to overwrite branch-b

is that okay ?

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