-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
git-switch: add page #3246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git-switch: add page #3246
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| # git switch | ||
|
|
||
| > Switch between git branches. Requires git version 2.23+. | ||
| > See also `git checkout`. | ||
| > More information: <https://git-scm.com/docs/git-switch/>. | ||
|
|
||
| - Switch to an existing branch: | ||
|
|
||
| `git switch {{branch_name}}` | ||
|
|
||
| - Create a new branch and switch to it: | ||
|
|
||
| `git switch --create {{branch_name}}` | ||
|
|
||
| - Create a new branch based on an existing commit: | ||
|
|
||
| `git switch --create {{branch_name}} {{start_point}}` | ||
|
||
|
|
||
| - Also update all submodules: | ||
|
||
|
|
||
| `git switch --recurse-submodules` | ||
|
||
|
|
||
| - Automatically merge the old branch and any uncommitted changes into the new branch: | ||
|
||
|
|
||
| `git switch --merge {{branch_name}}` | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"...and switch to it". Otherwise this is the same as
git branch {{branch_name}} {{commit}}.