I haven’t written a blog for a long time. Recently, I was idle at home and wanted to host the blog built by Hexo with Git to realize the synchronization management of the computer. I used to write in the laptop, but now I prefer to use the desktop at home

I. Problems encountered

Since themes/ hexo-theme-Icarus is also pulled from the repository, it is associated with the author’s Git repository and cannot be submitted

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")
Copy the code

Second, solutions

  1. Delete the folder from the staging area

    Git rm -- Cache themes/ theme file nameCopy the code

    For example, mine is hexo-theme-Icarus

    git rm --cache themes/hexo-theme-icarus
    Copy the code

Set the themes/hexo-theme-icarus/.git folder in the same location as the plugin-hexo-theme-icarus /.gitignore folder

  1. Git status Displays the current 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/
    Copy the code
  2. Just follow the steps and submit

    git add .
    git commit -m "add themes"
    git push
    Copy the code

    Move your.git folder back

    🆗🆗 toss over dry rice to go

    Check out my blog xiaobaicai.fun for more