banner
MACSITE

@MACSITE

兴趣是学习的动力,学习也能成为消遣!--你愁啥-ncs.fun

git cannot add files under a folder

When deploying the blogger's static blog at www.ncs.fun using vercel+github,

it is not possible to directly add theme files under the github project.#

I did a messy search on Google and Baidu 😵, and it was confusing.

Maybe I didn't describe it clearly, and the search engine couldn't give accurate results.

I can only use the shortcut of submodule, where the subproject is not updated by vercel 😓, maybe I don't know how to use it?

If anyone knows how to use it, please let me know, thank you.

There was a time when I used the npm command to install the theme, but I couldn't modify the theme files, which was very troublesome.

Recently, I found that it may be because there is a .git folder in the subfolder, which prevents uploading.#

I deleted any folder that contains .git, including this folder .github.

The next theme has two .git folders.

After deleting the .git in the subfolder, if you still can't commit files in the subfolder.

You can try the following method: replace "directory" with the theme/next that you are prompted.

 git rm --cached directory
 git add directory
Note: "directory" is the path of the subfolder.

But when executing git rm --cached directory, it prompts

fatal: Unable to create 'xx/.git/index.lock': File exists.
Executing rm -f xx/.git/index.lock resolved the issue.

Success#

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.