Undo git update-index --skip-worktree

后端 未结 7 2022
陌清茗
陌清茗 2020-12-07 07:43

A while ago I did this to ignore changes to a file tracked by git:

git update-index --skip-worktree 

Now I actually want to com

相关标签:
7条回答
  • 2020-12-07 08:44

    This answer is aimed at less technical people using Windows.

    If you don't remember/know which files you clicked "skip-worktree" on then use:

    git ls-files -v             //This will list all files, you are looking for the ones with an S at the beginning of the line. 
    
    git ls-files -v | grep "S " //Use this to show only the lines of interest. Those are the files that have "skip-worktree".
    

    To fix your problem:

    You can go to the files -> right click -> restore to a previous version -> click the "git" tab on top -> uncheck the "skip-worktree" checkbox -> click "Apply" at the bottom.

    If the files are too many to fix by hand then you'll need to refer to the other answers.

    0 讨论(0)
提交回复
热议问题