Love My Love

Clone Hugo To Other Desktop

2020.07.30

First of all, I will never use coding.net or gitee for my blog repos deploy, they are not confortable to me, so sad, so bad.

My hugo have three repos:

  1. hugo(hugo resource, private repo) - root
  2. zozo(theme/zozo, private repo) - submodule
  3. public(html files, public repo) - submodule

Maybe, you have this structure too.
I clone my repo hugo to my other desktop, but theme and public folders are blank.
Now, fix it!

Reference:

https://git-scm.com/book/zh/v2/Git-%E5%B7%A5%E5%85%B7-%E5%AD%90%E6%A8%A1%E5%9D%97
https://gohugo.io/hosting-and-deployment/hosting-on-github/

How:

1. Just for submodules folders empty

  1. make sure .gitmodule is correct.
  2. maybe .gitmodule sames right, but cannot work, git submodule sync.
  3. run git submodule init then git submodule update to update

2. Even not cloned

Just run git clone https://github.com/wedojava/blog.git --recurse-submodules, after this, submodules will be fetched done. then, you may make some changes, need push, just do it, but notion that, cd your submodule folders and push them first may give you best wishes.

Issue:

If some submodule cannot push and at the weird branch, just go to that path, run git switch master then git push or git pull.


Yes, just so easy as there. Here you go.

发表评论