Hexo主题themes/ 文件夹无法提交到GitHub的解决方法
好久没写博客了
最近在家里闲着无聊想把hexo搭建的博客用git来托管实现电脑的同步管理
以前都是在笔记本电脑里写 现在回到家更喜欢用台式机
so 就有了这样的想法 🆗 现在开始折腾
一、遇到的问题
因为themes/hexo-theme-icarus
也是从仓库里拉取下来的 他关联到了作者的git仓库
所以提交不上去
1 | C:\Users\WeiLin\Desktop\weilin-liao.github (master -> origin) |
二、解决方案
从暂存区删除该文件夹
1
git rm --cache themes/主题文件名
比如我的是主题是
hexo-theme-icarus
1
git rm --cache themes/hexo-theme-icarus
- 把
themes/hexo-theme-icarus/.git
文件夹到放到位置 比方说桌面
记得把themes/hexo-theme-icarus/.gitignore
里的_config
去掉
git status查看当前状态
1
2
3
4
5
6
7
8
9
10
11
12C:\Users\WeiLin\Desktop\weilin-liao.github (master -> origin)
λ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
deleted: themes/hexo-theme-icarus
Untracked files:
(use "git add <file>..." to include in what will be committed)
themes/直接按步骤提交就行了
1
2
3git add .
git commit -m "add themes"
git push后面再把刚刚的.git文件夹移动回去
🆗🆗折腾完了 干饭去了
Hexo主题themes/ 文件夹无法提交到GitHub的解决方法
https://weilin-liao.github.io/passages/2021/02/04/Hexo主题themes-文件夹无法提交到GitHub的解决方法/