mirror of
https://github.com/namibia/tips.git
synced 2024-12-23 02:28:58 +00:00
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:
parent
c358de0fcc
commit
0286eb3314
@ -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)
|
* [Show git status short](#show-git-status-short)
|
||||||
* [Checkout a commit prior to a day ago](#checkout-a-commit-prior-to-a-day-ago)
|
* [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)
|
* [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)
|
||||||
|
|
||||||
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
|
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
|
||||||
<!-- @doxie.inject end toc -->
|
<!-- @doxie.inject end toc -->
|
||||||
@ -1167,5 +1168,10 @@ git checkout master@{yesterday}
|
|||||||
git push -u origin <branch_name>
|
git push -u origin <branch_name>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Change a branch base
|
||||||
|
```sh
|
||||||
|
git rebase --onto <new_base> <old_base>
|
||||||
|
```
|
||||||
|
|
||||||
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
|
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
|
||||||
<!-- @doxie.inject end -->
|
<!-- @doxie.inject end -->
|
||||||
|
@ -493,5 +493,9 @@
|
|||||||
}, {
|
}, {
|
||||||
"title": "Push a new local branch to remote repository and track",
|
"title": "Push a new local branch to remote repository and track",
|
||||||
"tip": "git push -u origin <branch_name>"
|
"tip": "git push -u origin <branch_name>"
|
||||||
|
}, {
|
||||||
|
"title": "Change a branch base",
|
||||||
|
"tip": "git rebase --onto <new_base> <old_base>"
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user