git submodule modified files status

后端 未结 3 1916
说谎
说谎 2021-01-30 04:23

I\'ve added a submodule in my main git folder tree and haven\'t changed anything but it\'s showing up modified. What do I do about this?

$ git status
# On branc         


        
3条回答
  •  闹比i
    闹比i (楼主)
    2021-01-30 04:47

    I got in this state by mistakenly adding a submodule by specifically adding a directory instead of just adding the content of a new directory.

    I needed just to remove the submodule like this:

    git rm --cached path/to/my/new_directory
    

    And then add the contents like I intended to in the first place:

    git add path/to/my/new_directory/*
    

提交回复
热议问题