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}}
{{if .ShowMergeInstructions}}
@@ -24,31 +24,31 @@
-
git checkout {{.PullRequest.BaseBranch}}
+
git switch {{.PullRequest.BaseBranch}}
git merge --no-ff {{$localBranch}}
-
git checkout {{$localBranch}}
+
git switch {{$localBranch}}
git rebase {{.PullRequest.BaseBranch}}
-
git checkout {{.PullRequest.BaseBranch}}
+
git switch {{.PullRequest.BaseBranch}}
git merge --ff-only {{$localBranch}}
-
git checkout {{$localBranch}}
+
git switch {{$localBranch}}
git rebase {{.PullRequest.BaseBranch}}
-
git checkout {{.PullRequest.BaseBranch}}
+
git switch {{.PullRequest.BaseBranch}}
git merge --no-ff {{$localBranch}}
-
git checkout {{.PullRequest.BaseBranch}}
+
git switch {{.PullRequest.BaseBranch}}
git merge --squash {{$localBranch}}
-
git checkout {{.PullRequest.BaseBranch}}
+
git switch {{.PullRequest.BaseBranch}}
git merge --ff-only {{$localBranch}}
-
git checkout {{.PullRequest.BaseBranch}}
+
git switch {{.PullRequest.BaseBranch}}
git merge {{$localBranch}}
git push origin {{.PullRequest.BaseBranch}}