mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-10 15:35:59 +01:00
Add SSH clone url option when enabled SSH access
This commit is contained in:
@@ -7,21 +7,37 @@
|
|||||||
@if(!hasWritePermission){
|
@if(!hasWritePermission){
|
||||||
<h3>This is an empty repository</h3>
|
<h3>This is an empty repository</h3>
|
||||||
} else {
|
} else {
|
||||||
|
<h3><strong>Quick setup</strong> — if you've done this kind of thing before</h3>
|
||||||
|
<div class="empty-repo-options">
|
||||||
|
via <a href="@repository.httpUrl" class="git-protocol-selector">HTTP</a>
|
||||||
|
@if(settings.ssh && loginAccount.isDefined){
|
||||||
|
or
|
||||||
|
<a href="@repository.sshUrl(settings.sshPort.getOrElse(service.SystemSettingsService.DefaultSshPort), loginAccount.get.userName)" class="git-protocol-selector">SSH</a>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
<h3 style="margin-top: 30px;">Create a new repository on the command line</h3>
|
<h3 style="margin-top: 30px;">Create a new repository on the command line</h3>
|
||||||
<pre>
|
<pre>
|
||||||
touch README.md
|
touch README.md
|
||||||
git init
|
git init
|
||||||
git add README.md
|
git add README.md
|
||||||
git commit -m "first commit"
|
git commit -m "first commit"
|
||||||
git remote add origin @repository.httpUrl
|
git remote add origin <span class="live-clone-url">@repository.httpUrl</span>
|
||||||
git push -u origin master
|
git push -u origin master
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3 style="margin-top: 30px;">Push an existing repository from the command line</h3>
|
<h3 style="margin-top: 30px;">Push an existing repository from the command line</h3>
|
||||||
<pre>
|
<pre>
|
||||||
git remote add origin @repository.httpUrl
|
git remote add origin <span class="live-clone-url">@repository.httpUrl</span>
|
||||||
git push -u origin master
|
git push -u origin master
|
||||||
</pre>
|
</pre>
|
||||||
|
<script>
|
||||||
|
$(function(){
|
||||||
|
$('.git-protocol-selector').click(function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
$('.live-clone-url').text($(e.target).attr('href'));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user