-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocal-search.xml
More file actions
59 lines (27 loc) · 9.83 KB
/
Copy pathlocal-search.xml
File metadata and controls
59 lines (27 loc) · 9.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title>Hexo + VsCode 实现博客部署</title>
<link href="/2022/08/23/Hexo+VsCode/"/>
<url>/2022/08/23/Hexo+VsCode/</url>
<content type="html"><![CDATA[<h2 id="Hexo环境部署"><a href="#Hexo环境部署" class="headerlink" title="Hexo环境部署"></a>Hexo环境部署</h2><p>参考<a href="https://hexo.io/zh-cn/docs/">Hexo官方文档</a></p><h2 id="VsCode配置"><a href="#VsCode配置" class="headerlink" title="VsCode配置"></a>VsCode配置</h2><h3 id="插件"><a href="#插件" class="headerlink" title="插件"></a>插件</h3><ol><li>vscode-hexo: 实现Hexo命令提示</li><li>Hexo Utils: 添加侧栏, 便于操作</li><li>更多MarkDown插件: Markdown All in One</li></ol><h3 id="部署命令"><a href="#部署命令" class="headerlink" title="部署命令"></a>部署命令</h3><figure class="highlight crystal"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs crystal"><span class="hljs-variable">$ </span>hexo d -g<br></code></pre></td></tr></table></figure><p>全称: hexo deploy –generate (生成并部署)</p>]]></content>
</entry>
<entry>
<title>Hello World</title>
<link href="/2022/08/23/hello-world/"/>
<url>/2022/08/23/hello-world/</url>
<content type="html"><![CDATA[<p>Welcome to <a href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p><h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ hexo new <span class="hljs-string">"My New Post"</span><br></code></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/writing.html">Writing</a></p><h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ hexo server<br></code></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/server.html">Server</a></p><h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ hexo generate<br></code></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/generating.html">Generating</a></p><h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">$ hexo deploy<br></code></pre></td></tr></table></figure><p>More info: <a href="https://hexo.io/docs/one-command-deployment.html">Deployment</a></p>]]></content>
</entry>
<entry>
<title>SSH多用户配置</title>
<link href="/2022/08/23/SSH%E5%A4%9A%E7%94%A8%E6%88%B7%E9%85%8D%E7%BD%AE/"/>
<url>/2022/08/23/SSH%E5%A4%9A%E7%94%A8%E6%88%B7%E9%85%8D%E7%BD%AE/</url>
<content type="html"><![CDATA[<h3 id="多用户配置"><a href="#多用户配置" class="headerlink" title="多用户配置"></a>多用户配置</h3><p><a href="https://www.jianshu.com/p/12badb7e6c10">参考链接</a></p><p>首先找到SSH文件目录</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs plaintext">C:\Users\test\.ssh<br></code></pre></td></tr></table></figure><p>目录里应该有config文件, 保证格式如下</p><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs yaml"><span class="hljs-comment"># Github user1 (default user)</span><br><span class="hljs-string">Host</span> <span class="hljs-string">github.com</span><br><span class="hljs-string">HostName</span> <span class="hljs-string">github.com</span><br><span class="hljs-string">PreferredAuthentications</span> <span class="hljs-string">publickey</span><br><span class="hljs-comment"># 指定特定的ssh私钥文件</span><br><span class="hljs-string">IdentityFile</span> <span class="hljs-string">~/.ssh/id_rsa</span><br><br><span class="hljs-comment"># Github user2</span><br><span class="hljs-string">Host</span> <span class="hljs-string">github-enterhalf</span><br><span class="hljs-string">HostName</span> <span class="hljs-string">github.com</span><br><span class="hljs-string">PreferredAuthentications</span> <span class="hljs-string">publickey</span><br><span class="hljs-comment"># 指定特定的ssh私钥文件</span><br><span class="hljs-string">IdentityFile</span> <span class="hljs-string">~/.ssh/id_rsa_enterhalf</span><br></code></pre></td></tr></table></figure><p>Host需要保证是唯一的, 连接ssh时, 选择不同的Host名进行连接</p><p>原本的ssh:</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs plaintext">git@github.com:enterhalf/enterhalf.github.io.git<br></code></pre></td></tr></table></figure><p>更改后的ssh, 与上方定义的相同即可:</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs plaintext">git@github-enterhalf:enterhalf/enterhalf.github.io.git<br></code></pre></td></tr></table></figure><p>原本测试ssh是否正常连接到Github:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">ssh -T git@github.com<br></code></pre></td></tr></table></figure><p>更改后测试ssh是否正常连接到Github:</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs plaintext">ssh -T git@github-enterhalf<br></code></pre></td></tr></table></figure><p>HostName 则是各个代码托管平台的地址: github.com gitee.com</p><h3 id="自定义提交用户信息"><a href="#自定义提交用户信息" class="headerlink" title="自定义提交用户信息"></a>自定义提交用户信息</h3><p><a href="https://blog.csdn.net/yuanlaijike/article/details/95650625">参考链接</a></p><p>SSH秘钥设置成功后, 无需登录Git账号即可推送到Github仓库<br>由于无需登录, 在Github仓库上显示的提交用户可以是<strong>任何人</strong></p><p>提交用户的显示优先级分为三级别, System —> Global —>Local; System 即系统级别, 为系统主机名, Global 为配置的全局, Local 为仓库级别, 优先级是 Local > Global > System</p><p>进入仓库文件夹后, 输入以下命令, 即可更改仓库的Local信息</p><p>更改提交人昵称</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">git config --<span class="hljs-built_in">local</span> user.name <span class="hljs-string">"enterhalf"</span><br></code></pre></td></tr></table></figure><p>更改提交人邮箱信息, Github会自动关联该邮箱</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">git config --<span class="hljs-built_in">local</span> user.email <span class="hljs-string">"enterhalf@qq.com"</span><br></code></pre></td></tr></table></figure><p>清除global用户信息</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">git config --global --<span class="hljs-built_in">unset</span> user.name<br>git config --global --<span class="hljs-built_in">unset</span> user.email<br></code></pre></td></tr></table></figure><h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><ul><li>下次要使用第二个用户的时候, 仓库的ssh需要自己修改一次</li><li>使用第二个用户时, 仓库的local提交用户也需要更改</li></ul><h2 id="参考链接"><a href="#参考链接" class="headerlink" title="参考链接"></a>参考链接</h2><p><a href="https://docs.github.com/cn/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent">Github配置SSH官方文档</a></p>]]></content>
</entry>
<entry>
<title>new article</title>
<link href="/2022/08/22/new%20article/"/>
<url>/2022/08/22/new%20article/</url>
<content type="html"><![CDATA[<p>Hello Hexo, Here is a new article.</p>]]></content>
</entry>
</search>