git语法高亮

This commit is contained in:
fofolee
2019-05-07 10:40:55 +08:00
parent 6ae6134047
commit 409f6fc5c1
160 changed files with 605 additions and 605 deletions

View File

@@ -1,12 +1,12 @@
<div class="c-markdown doc-markdown"><div class="doc-postil"><div class="c-markdown"><h2>名称</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>git-shell  - 仅限 Git-SSH 访问的受限登录 shell</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>概要</h2></div></div><div class="doc-postil"><div class="c-markdown"><pre class="prism-token token language-javascript">chsh -s $(command -v git-shell) &lt;user&gt;git clone &lt;user&gt;@localhost:/path/to/repo.git
<div class="c-markdown doc-markdown"><div class="doc-postil"><div class="c-markdown"><h2>名称</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>git-shell  - 仅限 Git-SSH 访问的受限登录 shell</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>概要</h2></div></div><div class="doc-postil"><div class="c-markdown"><pre><code class="language-Bash">chsh -s $(command -v git-shell) &lt;user&gt;git clone &lt;user&gt;@localhost:/path/to/repo.git
ssh &lt;user&gt;@localhost</code></pre></div></div><div class="doc-postil"><div class="c-markdown"><h2>描述</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>这是 SSH 帐户的登录外壳,用于提供受限制的 Git 访问。它只允许执行实现拉/推功能的服务器端 Git 命令,以及<code>git-shell-commands</code>在用户主目录中命名的子目录中存在的自定义命令。</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>命令</h2></div></div><div class="doc-postil"><div class="c-markdown"><p><code>git shell</code><code>-c</code>选项后接受以下命令:</p></div></div><div class="doc-postil"><div class="c-markdown"><p><em style="font-style: italic;">git receive-pack &lt;argument&gt;</em>   <em style="font-style: italic;">git upload-pack &lt;argument&gt;</em>   <em style="font-style: italic;">git upload-archive &lt;argument&gt;</em></p></div></div><div class="doc-postil"><div class="c-markdown"><p>调用相应的服务器端命令,以支持客户端的<code>git push</code><code>git fetch</code><code>git archive --remote</code>请求。</p></div></div><div class="doc-postil"><div class="c-markdown"><p><em style="font-style: italic;">cvs server</em></p></div></div><div class="doc-postil"><div class="c-markdown"><p>模仿 CVS 服务器。参见 git-cvsserver [1]。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>如果存在<code>~/git-shell-commands</code>目录,则<code>git shell</code>还将通过在用户的主目录中运行“ <code>git-shell-commands/&lt;command&gt; &lt;arguments&gt;</code>”来处理其他自定义命令。</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>交互式使用</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>默认情况下,上述命令只能使用该<code>-c</code>选项执行; 该 shell 不是交互式的。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>如果<code>~/git-shell-commands</code>目录存在,<code>git shell</code>也可以交互式运行(不带参数)。如果目录中<code>help</code>存在命令<code>git-shell-commands</code>则会向用户提供允许的操作概述。然后出现一个“git&gt;”提示符,用户可以输入<code>git-shell-commands</code>目录中的任何命令或<code>exit</code>关闭连接。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>通常,此模式用作管理界面,以允许用户列出他们有权访问的存储库,创建,删除或重命名存储库,或更改存储库描述和权限。</p></div></div><div class="doc-postil"><div class="c-markdown"><p>如果<code>no-interactive-login</code>命令存在,则运行它并交互式 shell 被中止。</p></div></div><div class="doc-postil"><div class="c-markdown"><h2>示例</h2></div></div><div class="doc-postil"><div class="c-markdown"><p>To disable interactive logins, displaying a greeting instead:</p></div></div><div class="doc-postil"><div class="c-markdown"><pre><code class="language-Bash">$ chsh -s /usr/bin/git-shell
$ mkdir $HOME/git-shell-commands
$ cat &gt;$HOME/git-shell-commands/no-interactive-login &lt;&lt;\EOF
$ cat &gt;$HOME/git-shell-commands/no-interactive-login &lt;&lt;\EOF
#!/bin/sh
printf '%s\n' "Hi $USER! You've successfully authenticated, but I do not"printf '%s\n' "provide interactive shell access."exit 128EOF