好久没写博客了
最近在家里闲着无聊想把hexo搭建的博客用git来托管实现电脑的同步管理
以前都是在笔记本电脑里写 现在回到家更喜欢用台式机
so 就有了这样的想法 🆗 现在开始折腾
一、遇到的问题
因为themes/hexo-theme-icarus
也是从仓库里拉取下来的 他关联到了作者的git仓库
所以提交不上去
C:\Users\WeiLin\Desktop\weilin-liao.github (master -> origin)
λ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: themes/hexo-theme-icarus (modified content, untracked content)
no changes added to commit (use "git add" and/or "git commit -a")
二、解决方案
-
从暂存区删除该文件夹
git rm --cache themes/主题文件名
比如我的是主题是
hexo-theme-icarus
git rm --cache themes/hexo-theme-icarus
把 themes/hexo-theme-icarus/.git
文件夹到放到位置 比方说桌面
记得把 themes/hexo-theme-icarus/.gitignore
里的 _config
去掉
-
git status查看当前状态
C:\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/
-
直接按步骤提交就行了
git add . git commit -m "add themes" git push
后面再把刚刚的.git文件夹移动回去
🆗🆗折腾完了 干饭去了
更多内容关注我的博客 https://xiaobaicai.fun