tldr/pages/common/git-rebase.md

24 lines
604 B
Markdown
Raw Normal View History

# git rebase
2016-01-21 12:08:45 +00:00
> Apply local commits on top of another branch's history.
2016-01-21 12:08:45 +00:00
- Rebase your local branch interactively with the latest changes in local master:
2015-12-30 17:36:58 +00:00
`git rebase -i master`
2016-09-21 07:58:28 +01:00
- Rebase your local branch interactively with the latest changes from upstream:
2015-12-30 17:36:58 +00:00
`git fetch origin; git rebase -i origin/master`
2016-01-21 12:08:45 +00:00
- Handle an active rebase merge failure, after editing conflicting file(s):
2015-12-30 17:36:58 +00:00
`git rebase --continue`
2016-01-21 12:08:45 +00:00
- Abort a rebase in-progress:
2015-12-30 17:36:58 +00:00
`git rebase --abort`
2016-09-21 07:58:28 +01:00
- Rebase your local branch by specifying new base commit and old base commit:
`git rebase --onto {{new_base_commit}} {{old_base_commit}}`