Closed pskyhx closed 2 years ago
A hint from [Issue with adding common code as git submodule: "already exists in the index" - Stack Overflow](https://stackoverflow.com/questions/12898278/issue-with-adding-common-code-as-git-submodule-already-exists-in-the-index)
```bash $ git ls-files --stage themes/zen 160000 e83282718738b6b960fb8fbf2bd81d971ec8b096 0 themes/zen
$ git rm --cached themes/zen rm 'themes/zen'
$ git submodule add git@github.com:ragynotes/hugo-theme-zen.git themes/zen fatal: 'themes/zen' already exists and is not a valid git repo
$ git ls-files --stage themes/zen
$ git submodule add git@github.com:ragynotes/hugo-theme-zen.git themes/zen fatal: 'themes/zen' already exists and is not a valid git repo ```
the solution:
$ git rm --cached themes/zen $ git rm -r --cached themes/zen $ rm -r --cached themes/zen
A hint from [Issue with adding common code as git submodule: "already exists in the index" - Stack Overflow](https://stackoverflow.com/questions/12898278/issue-with-adding-common-code-as-git-submodule-already-exists-in-the-index)
```bash
$ git ls-files --stage themes/zen
160000 e83282718738b6b960fb8fbf2bd81d971ec8b096 0 themes/zen
$ git rm --cached themes/zen
rm 'themes/zen'
$ git submodule add git@github.com:ragynotes/hugo-theme-zen.git themes/zen
fatal: 'themes/zen' already exists and is not a valid git repo
$ git ls-files --stage themes/zen
$ git submodule add git@github.com:ragynotes/hugo-theme-zen.git themes/zen
fatal: 'themes/zen' already exists and is not a valid git repo
```