mirror of https://github.com/CrimsonTome/tldr.git
git-rebase: hopefully clarify some points
parent
c3146ede2a
commit
8f18647c82
|
@ -1,23 +1,24 @@
|
||||||
# git rebase
|
# git rebase
|
||||||
|
|
||||||
> Apply local commits on top of another branch's history.
|
> Apply local commits on top of another branch's history.
|
||||||
|
> This effectively "moves" an entire branch to another base, by creating copies of the commits in the new location.
|
||||||
|
|
||||||
- Rebase your local branch interactively with the latest changes in local master:
|
- Rebase the current branch on top of the master branch:
|
||||||
|
|
||||||
`git rebase -i master`
|
`git rebase master`
|
||||||
|
|
||||||
- Rebase your local branch interactively with the latest changes from upstream:
|
- Start an interactive rebase, which allows the commits to be reordered, omitted, combined or modified:
|
||||||
|
|
||||||
`git fetch origin; git rebase -i origin/master`
|
`git rebase -i {{target_base_branch}}`
|
||||||
|
|
||||||
- Handle an active rebase merge failure, after editing conflicting file(s):
|
- Continue a rebase that was interrupted by a merge failure, after editing conflicting files:
|
||||||
|
|
||||||
`git rebase --continue`
|
`git rebase --continue`
|
||||||
|
|
||||||
- Abort a rebase in-progress:
|
- Abort a rebase in progress (e.g. if it is interrupted by a merge conflict):
|
||||||
|
|
||||||
`git rebase --abort`
|
`git rebase --abort`
|
||||||
|
|
||||||
- Rebase your local branch by specifying new base commit and old base commit:
|
- Rebase a branch starting from a specific base commit, rather than the common ancestor shared with the target branch:
|
||||||
|
|
||||||
`git rebase --onto {{new_base_commit}} {{old_base_commit}}`
|
`git rebase --onto {{new_base_commit}} {{old_base_commit}}`
|
||||||
|
|
Loading…
Reference in New Issue