.gitignore not ignoring .idea path

前端 未结 9 1950
无人及你
无人及你 2021-01-29 18:29

What am I missing that needs to be done in order to get git to ignore my .idea/ path?

ctote@ubuntu:~/dev/1$ git status
On branch master         


        
相关标签:
9条回答
  • 2021-01-29 18:58

    To remove the "fatal: pathspec '.idea' did not match any files" just use if the dir still returns as untracked:

    git clean -f -d .idea

    0 讨论(0)
  • 2021-01-29 18:58

    For those of you getting fatal: pathspec '.idea' did not match any files:

    You just have to include the full path to the .idea folder.

    So first, do a git status, which should show you the path to .idea given where you currently are.

    Then, include the path in the command w0lf suggested: git rm --cached -r example/path/to/.idea

    0 讨论(0)
  • 2021-01-29 19:00

    To Solve Error "fatal: pathspec '.idea' did not match any files" after entering above command,

    1. Check the path of your idea folder and its files.
    2. For this do git status. It will list all the files as usual. Check the path of idea folder files. Mine was at ../.idea/workspace.xml. Notice the ../.idea
    3. Modify the above suggested command in the accepted answer to git rm --cached -r ../.idea
    4. You will then see this rm '.idea/workspace.xml' and the files will be removed.
    0 讨论(0)
提交回复
热议问题