summaryrefslogtreecommitdiffstats
path: root/templates/repo/empty.tmpl
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-03-26 19:14:51 +0000
committerGitHub <noreply@github.com>2020-03-26 19:14:51 +0000
commit52cfd2743c0e85b36081cf80a850e6a5901f1865 (patch)
tree9b13df2465992cf00fdeb375dd04bd7c17c09f65 /templates/repo/empty.tmpl
parentb1c331c84596f73aeab60178daf92f3539e026b9 (diff)
downloadgitea-52cfd2743c0e85b36081cf80a850e6a5901f1865.tar.gz
gitea-52cfd2743c0e85b36081cf80a850e6a5901f1865.zip
Option to set default branch at repository creation (#10803)
* Option to set default branch at repository creation * Handle template repos with non-default master branch * Add DefaultBranch handling on creation to API Fix #9542 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'templates/repo/empty.tmpl')
-rw-r--r--templates/repo/empty.tmpl4
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl
index d6965d6fb9..8efb6d2866 100644
--- a/templates/repo/empty.tmpl
+++ b/templates/repo/empty.tmpl
@@ -52,7 +52,7 @@ git init
git add README.md
git commit -m "first commit"
git remote add origin <span class="clone-url">{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}</span>
-git push -u origin master</code></pre>
+git push -u origin {{if ne .Repository.DefaultBranch "master"}}master:{{.Repository.DefaultBranch}}{{else}}master{{end}}</code></pre>
</div>
</div>
<div class="ui divider"></div>
@@ -61,7 +61,7 @@ git push -u origin master</code></pre>
<h3>{{.i18n.Tr "repo.push_exist_repo"}}</h3>
<div class="markdown">
<pre><code>git remote add origin <span class="clone-url">{{if $.DisableSSH}}{{$.CloneLink.HTTPS}}{{else}}{{$.CloneLink.SSH}}{{end}}</span>
-git push -u origin master</code></pre>
+git push -u origin {{.Repository.DefaultBranch}}</code></pre>
</div>
</div>
{{end}}