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```
This commit is contained in:
Léni Marvaud 2018-03-21 20:24:10 +01:00 committed by lmarvaud
parent c358de0fcc
commit 0286eb3314
2 changed files with 10 additions and 0 deletions

View File

@ -166,6 +166,7 @@ P.S: All these commands are tested on `git version 2.7.4 (Apple Git-66)`.
* [Show git status short](#show-git-status-short)
* [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago)
* [Push a new local branch to remote repository and track](#push-a-new-local-branch-to-remote-repository-and-track)
* [Change a branch base](#change-a-branch-base)
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end toc -->
@ -1167,5 +1168,10 @@ git checkout master@{yesterday}
git push -u origin <branch_name>
```
## Change a branch base
```sh
git rebase --onto <new_base> <old_base>
```
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end -->

View File

@ -493,5 +493,9 @@
}, {
"title": "Push a new local branch to remote repository and track",
"tip": "git push -u origin <branch_name>"
}, {
"title": "Change a branch base",
"tip": "git rebase --onto <new_base> <old_base>"
}
]