.gitignore and Visual Studio project: Ignore bin/Debug directory but not bin/Release directory

后端 未结 9 998
一个人的身影
一个人的身影 2021-01-30 03:51

I have a C# Visual Studio project in a git repository. I want to ignore the contents bin/Debug directory but not the contents of the bin/Release\' dire

9条回答
  •  自闭症患者
    2021-01-30 04:31

    This typically happens because the .gitignore was added after the files were committed. The .gitignore tells git to ignore untracked files that match, once stuff is committed the ignore will no longer work. One way to fix it is to remove the bin/debug folder (manually through explorer/powershell/bash), then commit the removals. Once that is done the ignores should work as you expect.

    1. Remove files/folder
    2. git add -A
    3. git commit

提交回复
热议问题