diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl index d3a81bc51d..2032b7e5d2 100644 --- a/templates/repo/empty.tmpl +++ b/templates/repo/empty.tmpl @@ -51,7 +51,7 @@
touch README.md
git init
-{{if ne .Repository.DefaultBranch "master"}}git checkout -b {{.Repository.DefaultBranch}}{{end}}
+{{if ne .Repository.DefaultBranch "master"}}git switch -c {{.Repository.DefaultBranch}}{{end}}
git add README.md
git commit -m "first commit"
git remote add origin {{$.CloneButtonOriginLink.HTTPS}}
diff --git a/templates/repo/issue/view_content/pull_merge_instruction.tmpl b/templates/repo/issue/view_content/pull_merge_instruction.tmpl
index b7aae53424..dd30a3a8d6 100644
--- a/templates/repo/issue/view_content/pull_merge_instruction.tmpl
+++ b/templates/repo/issue/view_content/pull_merge_instruction.tmpl
@@ -12,7 +12,7 @@
{{else}}
git fetch -u origin +refs/pull/{{.PullRequest.Index}}/head:{{$localBranch}}
{{end}}
- git checkout {{$localBranch}}
+ git switch {{$localBranch}}