Skip to content

Commit bc869e3

Browse files
committed
Add change a branch base tips
Based on : https://stackoverflow.com/questions/10853935/change-branch-base Tested on `git version 2.11.0 (Apple Git-81)` : ```bash-4.3$ git --version git version 2.11.0 (Apple Git-81) bash-4.3$ git checkout -b test-rebase-onto Switched to a new branch 'test-rebase-onto' bash-4.3$ touch "test-to-rebase" bash-4.3$ git add test-to-rebase bash-4.3$ git commit -m "Commit to rebase" [test-rebase-onto 11d1cdd] Commit to rebase 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test-to-rebase bash-4.3$ git log bash-4.3$ git rebase --onto master dev Applying: Commit to rebase bash-4.3$ git log```
1 parent f2e6ca6 commit bc869e3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
166166
* [Show git status short](#show-git-status-short)
167167
* [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago)
168168
* [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track)
169+
* [Change a branch base](#change-a-branch-base)
169170

170171
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
171172
<!-- @doxie.inject end toc -->
@@ -1167,5 +1168,10 @@ git checkout master@{yesterday}
11671168
git push -u origin <branch_name>
11681169
```
11691170
1171+
## Change a branch base
1172+
```sh
1173+
git rebase --onto <new_base> <old_base>
1174+
```
1175+
11701176
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
11711177
<!-- @doxie.inject end -->

0 commit comments

Comments
 (0)