diff --git a/index.xml b/index.xml index ffec0a5..8aa2b74 100644 --- a/index.xml +++ b/index.xml @@ -512,15 +512,23 @@ data-flex-basis="522px" <pre tabindex="0" class="chroma"><code><span class="lnt">1 </span><span class="lnt">2 </span><span class="lnt">3 +</span><span class="lnt">4 +</span><span class="lnt">5 +</span><span class="lnt">6 </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 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><span class="line"><span class="cl"><span class="c1"># 如果merge 报错,如果确定了远程是需要拉到本地的情况,就stash</span> +</span></span><span class="line"><span class="cl">git stash +</span></span><span class="line"><span class="cl">git merge </span></span></code></pre></td></tr></table> </div> </div><p>参考:<a class="link" href="https://stackoverflow.com/questions/73338848/git-diff-show-nothing" target="_blank" rel="noopener" >如果git diff无反应怎么办</a></p> +<p>merge 报错:<a class="link" href="https://stackoverflow.com/questions/54746699/please-commit-your-changes-or-stash-them-before-you-merge" target="_blank" rel="noopener" +>如果merge提示报错怎么办</a></p> <p>到此就完成了两个主机上博客的更新部署,只不过需要在更新的时候先检查远程和本地的区别,然后再选择是否更新。</p> <h1 id="参考">参考</h1> <p>Hugo actions的指导:https://github.com/peaceiris/actions-hugo</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 aa8dfae..ef3adf4 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" @@ -171,10 +171,16 @@

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

1
 2
 3
+4
+5
+6
 
git fetch # 会在不更新本地仓库的情况下获取远程仓库的更新情况
 git diff --stat main origin/main # 比较本地和远程仓库内容区别,如果没有结果就是ok,如果有区别,视情况选择merge
 git merge # 将远程已经更新的内容更新到本地
-

参考:如果git diff无反应怎么办

到此就完成了两个主机上博客的更新部署,只不过需要在更新的时候先检查远程和本地的区别,然后再选择是否更新。

参考

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