Failed to execute "git add" on the Hexo project due to the theme submodule
date
Jun 9, 2022
slug
hexo-theme-submodule
status
Published
tags
Git
Hexo
Bugfix
summary
type
Post
Problem
I failed to
git add .
the source files of my Hexo
blog project, and the error said:What’s wrong
That was because inside this repository, I had cloned the theme files from another github repository.
So
Git
identifies the theme as a submodule.Solution
To solve this problem, follow the steps below:
- Get to where the theme directory is, and remove the
.git
folder within it
We can check if it’s removed successfully by listing out all the files within it:
- Remove cached files in root directory of our hexo project
- Add and commit all files again