Use git switch instead of git checkout for modern git usage (#119)

Git 2.23 came up with the new `git switch` command, which is not a new feature but an additional command to `switch/change branch` feature which is already available in the overloaded git checkout command.

By using `git switch --orphan pages`, it will create a new orphan branch.

Reviewed-on: https://codeberg.org/Codeberg/pages-server/pulls/119
Reviewed-by: 6543 <6543@noreply.codeberg.org>
Co-authored-by: Gary Wang <blumia@noreply.codeberg.org>
Co-committed-by: Gary Wang <blumia@noreply.codeberg.org>
This commit is contained in:
Gary Wang 2022-07-27 17:26:55 +02:00 committed by 6543
parent f5f9eb0860
commit 31b98b86ff

View File

@ -128,7 +128,7 @@
<div class="codeberg-divider"><hr>or<hr></div> <div class="codeberg-divider"><hr>or<hr></div>
<p> <p>
Create a branch <code class="code">pages</code> in a repository:<br> Create a branch <code class="code">pages</code> in a repository:<br>
<code class="code">git checkout --orphan pages</code><br><code class="code">git rm --cached -r .</code> <code class="code">git switch --orphan pages</code><br><code class="code">git rm --cached -r .</code>
</p> </p>
</div> </div>
<div class="col-lg text-center"> <div class="col-lg text-center">