問題
如下報錯,是因為子模塊中出現變更導致的走触。在我們想保留變更晦譬,又不想將其添加到子模塊的gitignore
文件中的時候,應該怎么辦呢互广?
? expwdx.github.io git:(gh-pages) git status
On branch gh-pages
Your branch is up to date with 'origin/gh-pages'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: themes/fluid (untracked content)
解決辦法
如下圖所示敛腌,在gitmodule
文件中的對應子模塊配置中增加ignore = dirty
即可。
- vim .gitmodule
[submodule "themes/3-hexo"]
path = themes/3-hexo
url = git@github.com:yelog/hexo-theme-3-hexo.git
[submodule "themes/next"]
path = themes/next
url = git@github.com:theme-next/hexo-theme-next.git
[submodule "themes/yilia"]
path = themes/yilia
url = git@github.com:litten/hexo-theme-yilia.git
[submodule "themes/material"]
path = themes/material
url = git@github.com:viosey/hexo-theme-material.git
[submodule "themes/fluid"]
path = themes/fluid
url = git@github.com:fluid-dev/hexo-theme-fluid.git
ignore = dirty
- git diff
diff --git a/.gitmodules b/.gitmodules
index ad752a7..de11a01 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -13,3 +13,4 @@
[submodule "themes/fluid"]
path = themes/fluid
url = git@github.com:fluid-dev/hexo-theme-fluid.git
+ ignore = dirty
(END)