git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] MyFirstContribution: use switch for changing branches

From
BFBenji Fisher <benji@fisherfam.org>
Date
Apr 7, 2024, 21:21 UTC
Message-ID
<20240407212109.35131-1-benji@FisherFam.org>
Use "git switch" instead of "git checkout" for changing branches.
Signed-off-by: Benji Fisher <benji@FisherFam.org>
---
 Documentation/MyFirstContribution.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/MyFirstContribution.txt b/Documentation/MyFirstContribution.txt
index f06563e981..66f38a7055 100644
--- a/Documentation/MyFirstContribution.txt
+++ b/Documentation/MyFirstContribution.txt
@@ -122,7 +122,7 @@ branch of the upstream project. Create the `psuh` branch you will use for
 development like so:
 
 ----
-$ git checkout -b psuh origin/master
+$ git switch -c psuh origin/master
 ----
 
 We'll make a number of commits here in order to demonstrate how to send a topic
@@ -878,7 +878,7 @@ on `master`, so go ahead and update as shown below, or using your preferred
 workflow.
 
 ----
-$ git checkout master
+$ git switch master
 $ git pull -r
 $ git rebase master psuh
 ----
@@ -1139,7 +1139,7 @@ We'll reuse our `psuh` topic branch for v2. Before we make any changes, we'll
 mark the tip of our v1 branch for easy reference:
 
 ----
-$ git checkout psuh
+$ git switch psuh
 $ git branch psuh-v1
 ----
 
-- 
2.40.1
Next: Junio C Hamano
Message 1 of 6 in “MyFirstContribution: use switch for changing branches”
  1. MyFirstContribution: use switch for changing branchesBenji Fisher, Apr 7, 2024
  2. Junio C HamanoApr 8, 2024
  3. Benji FisherApr 9, 2024
  4. Kipras Melnikovas, Apr 9, 2024
  5. Junio C HamanoApr 9, 2024
  6. Emily ShafferApr 9, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.