From c27b892910c085e07713603581e658d4f747ad8f Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 18 Aug 2019 14:00:05 +0100 Subject: [PATCH 1/4] git-switch: add page --- pages/common/git-switch.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 pages/common/git-switch.md diff --git a/pages/common/git-switch.md b/pages/common/git-switch.md new file mode 100644 index 00000000000000..63cb0c683b9680 --- /dev/null +++ b/pages/common/git-switch.md @@ -0,0 +1,26 @@ +# git switch + +> Switch between git branches. Requires git version 2.23+. +> See also `git checkout`. +> More information: . + +- 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}}` + From e031bd37e6105172a851104a09e737ee46717dea Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 18 Aug 2019 14:05:40 +0100 Subject: [PATCH 2/4] Update git-switch.md --- pages/common/git-switch.md | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/common/git-switch.md b/pages/common/git-switch.md index 63cb0c683b9680..85c8065efc4218 100644 --- a/pages/common/git-switch.md +++ b/pages/common/git-switch.md @@ -23,4 +23,3 @@ - Automatically merge the old branch and any uncommitted changes into the new branch: `git switch --merge {{branch_name}}` - From 14be8eb20e2034b158681ed365b20557abb0ab59 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 19 Aug 2019 11:37:35 +0100 Subject: [PATCH 3/4] Update git-switch.md --- pages/common/git-switch.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/common/git-switch.md b/pages/common/git-switch.md index 85c8065efc4218..ccafb17972a7e9 100644 --- a/pages/common/git-switch.md +++ b/pages/common/git-switch.md @@ -14,9 +14,9 @@ - Create a new branch based on an existing commit: -`git switch --create {{branch_name}} {{start_point}}` +`git switch --create {{branch_name}} {{commit}}` -- Also update all submodules: +- Update all submodules to match the target branch: `git switch --recurse-submodules` From 8d1c04badf4e891dab56dfd252829a8815df031d Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 19 Aug 2019 11:38:25 +0100 Subject: [PATCH 4/4] Update git-switch.md --- pages/common/git-switch.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/common/git-switch.md b/pages/common/git-switch.md index ccafb17972a7e9..d0baeb3a229351 100644 --- a/pages/common/git-switch.md +++ b/pages/common/git-switch.md @@ -18,8 +18,8 @@ - Update all submodules to match the target branch: -`git switch --recurse-submodules` +`git switch --recurse-submodules {{branch_name}}` -- Automatically merge the old branch and any uncommitted changes into the new branch: +- Automatically merge the current branch and any uncommitted changes into the new branch: `git switch --merge {{branch_name}}`