Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat]: 建议支持设置不同级别的 git 仓库 #21

Open
yafey opened this issue Oct 25, 2022 · 3 comments
Open

[feat]: 建议支持设置不同级别的 git 仓库 #21

yafey opened this issue Oct 25, 2022 · 3 comments

Comments

@yafey
Copy link

yafey commented Oct 25, 2022

hexo ------------------- git repo 1, hexo 级别设置。
+--hexon
+--source
     +--_posts  --------- git repo 2, submodule,post 的博文。
+--themes
     +-- next ----------- git repo 3, submodule,nexT 主题级别自定义设置。

目前如果配置 ssh 的话, 会把 hexon 也提交成一个 submodule 。
个人的想法是:如果可以做到 配置到 _posts 级别, 只更新博文相关, hexo 和 nexT 及 hexon 基本为固定或较少改动。

@yafey yafey changed the title [feat]: 支持设置不同级别的 git [feat]: 支持设置不同级别的 git 仓库 Oct 25, 2022
@yafey yafey changed the title [feat]: 支持设置不同级别的 git 仓库 [feat]: 建议支持设置不同级别的 git 仓库 Oct 25, 2022
@zS1m
Copy link
Contributor

zS1m commented Mar 29, 2023

hexo ------------------- git repo 1, hexo 级别设置。
+--hexon
+--source
     +--_posts  --------- git repo 2, submodule,post 的博文。
+--themes
     +-- next ----------- git repo 3, submodule,nexT 主题级别自定义设置。

目前如果配置 ssh 的话, 会把 hexon 也提交成一个 submodule 。 个人的想法是:如果可以做到 配置到 _posts 级别, 只更新博文相关, hexo 和 nexT 及 hexon 基本为固定或较少改动。

Hexon提供了自定义脚本的功能(pnpm script),我没理解错的话里面应该是可以执行任意git命令,那么就可以设置提交代码时提交哪些内容,比如只想提交博客目录下的_post文件夹可以使用下方命令:

git add ./_post

理解有误的话请指正

@YuJianghao
Copy link
Contributor

可以使用自定义脚本功能,pnpm script 配置 git 相关的脚本

添加需要运行的脚本:git_sync.sh, git_save.sh

hexo
+--hexon
+--git_sync.sh
+--git_save.sh
+--source
     +--_posts

git save 脚本设置成 bash ./git_save.sh

# git_save.sh
git add ./source/_posts
git commit -m "chore: server update posts"
git push

对于更复杂的配置可以根据实际情况修改

@zS1m
Copy link
Contributor

zS1m commented Mar 29, 2023

可以使用自定义脚本功能,pnpm script 配置 git 相关的脚本

添加需要运行的脚本:git_sync.sh, git_save.sh

hexo
+--hexon
+--git_sync.sh
+--git_save.sh
+--source
     +--_posts

git save 脚本设置成 bash ./git_save.sh

# git_save.sh
git add ./source/_posts
git commit -m "chore: server update posts"
git push

对于更复杂的配置可以根据实际情况修改

或许页面左上角的“操作”可以提供一个“增加自定义命令的功能”,允许用户增加多条快捷操作,这样楼主的需求也能够被很好地满足
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants