How to get rid of Git submodules untracked status?

后端 未结 10 1487
轻奢々
轻奢々 2020-12-07 08:14

I can\'t seem to get rid of untracked content in Git\'s submodules. Running git status yields:

# On branch master
# Changes not staged for commit:
#          


        
10条回答
  •  -上瘾入骨i
    2020-12-07 08:39

    I got stuck on this issue yesterday, in a project which had close to 12 submodules.

    git status was showing output.

    # On branch master
    # Changes not staged for commit:
    #   (use "git add ..." to update what will be committed)
    #   (use "git checkout -- ..." to discard changes in working directory)
    #   (commit or discard the untracked or modified content in submodules)
    #
    #   modified:   proj1 (untracked content)
    #   modified:   proj1 (modified content, untracked content)
    #   ...
    

    To resolve the untracked content error, I had to remove the untracked files from all submodules (all were *.pyc, *.pyo files generated by python) using a .gitignore.

    To resolve the other, I had to run git submodule update which updated each of the submodules.

提交回复
热议问题