diff --git a/index.xml b/index.xml index f226eb5..ffec0a5 100644 --- a/index.xml +++ b/index.xml @@ -510,12 +510,19 @@ data-flex-basis="522px" <div class="highlight"><div class="chroma"> <table class="lntable"><tr><td class="lntd"> <pre tabindex="0" class="chroma"><code><span class="lnt">1 +</span><span class="lnt">2 +</span><span class="lnt">3 </span></code></pre></td> <td class="lntd"> -<pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git diff main origin/main <span class="c1"># 比较本地和远程仓库内容区别,如果没有结果就是ok</span> +<pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git fetch <span class="c1"># 会在不更新本地仓库的情况下获取远程仓库的更新情况</span> +</span></span><span class="line"><span class="cl">git diff --stat main origin/main <span class="c1"># 比较本地和远程仓库内容区别,如果没有结果就是ok,如果有区别,视情况选择merge</span> +</span></span><span class="line"><span class="cl">git merge <span class="c1"># 将远程已经更新的内容更新到本地</span> </span></span></code></pre></td></tr></table> </div> -</div><h1 id="参考">参考</h1> +</div><p>参考:<a class="link" href="https://stackoverflow.com/questions/73338848/git-diff-show-nothing" target="_blank" rel="noopener" +>如果git diff无反应怎么办</a></p> +<p>到此就完成了两个主机上博客的更新部署,只不过需要在更新的时候先检查远程和本地的区别,然后再选择是否更新。</p> +<h1 id="参考">参考</h1> <p>Hugo actions的指导:https://github.com/peaceiris/actions-hugo</p> <p>报错解决:https://www.youtube.com/watch?v=DMgEGpqXEM4</p> <p>主题gitmodules:https://github.com/gohugoio/hugoThemes/blob/master/.gitmodules</p> diff --git "a/p/hugo-githubpages-actions\345\215\232\345\256\242\346\220\255\345\273\272/index.html" "b/p/hugo-githubpages-actions\345\215\232\345\256\242\346\220\255\345\273\272/index.html" index b8881c8..aa8dfae 100644 --- "a/p/hugo-githubpages-actions\345\215\232\345\256\242\346\220\255\345\273\272/index.html" +++ "b/p/hugo-githubpages-actions\345\215\232\345\256\242\346\220\255\345\273\272/index.html" @@ -169,8 +169,12 @@

这样图片直接复制到当前文件夹就行了。

双设备

如果有两个不同系统的笔记本,比如一个Ubuntu和一个Windows,可以在两个设备上同时clone下来仓库,比如已经完成了另一个设备上的git安装,还没clone仓库到本地时候。

首先将私钥复制到用户目录的ssh文件中,然后在相关目录中直接:

1
 
git clone ......
 

发生更新之后,即使博客的更新只有一个人,但是仍然需要检查是不是相比仓库发生了更新,如在win上更新之后但是没有pull,但是mac端先pull 到主要分支,如果下次在win上直接pull而不比较内容,会出现覆盖mac端pull的情况,所以需要检测当前的版本是不是最新的,如果和远程仓库有区别需要先把远程仓库的更新拉到本地然后pull:

1
-
git diff main origin/main # 比较本地和远程仓库内容区别,如果没有结果就是ok
-

参考

Hugo actions的指导:https://github.com/peaceiris/actions-hugo

报错解决:https://www.youtube.com/watch?v=DMgEGpqXEM4

主题gitmodules:https://github.com/gohugoio/hugoThemes/blob/master/.gitmodules

标题无法从一级标题开始显示:https://huweim.github.io/post/blog_hugo_%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84/

comments powered by Disqus