Gitignore skips some binaries (DLL and PE)

I am using the latest version of Github Desktop. My repo has a pretty big C # solution with many subdirectories and projects. I would like to ignore all R # -cache files and compiled binaries using the .gitignore file, which is in the root directory of the local repo directory. There are no other gitignore in this repo, and not one of them in any parent directories. My current gitignore:

*.suo *.user _ReSharper.* bin obj packages *.cache *.pdb *.dll *.exe *.xml 

When I made my changes, recompiled and tested everything, I open Github Desktop. It catches almost all files that should be ignored, only some .dll s, .pdb and .exe not ignored and are always displayed as changed:

img

Now there are some more binaries in this repo. Only those defined in screengrab are omitted.

Is it fixable and / or can gitignore be modified to catch all the files it needs to catch?

Here is what I tried:

  • Deleted and re-cloned repository
  • Deleted and manually restored gitignore
  • Right-click-> Ignore file extension from inside the GitHub Desktop client. This does not work, worse, it creates duplicate masks in gitignore
  • Checked for conflicting gitignore in directories available on Github Desktop
+5
source share
1 answer

Perhaps you have files that were already tracked with git before you changed .gitignore? These files (at least in git 1.9.1) are not ignored when added to .gitignore.

For example, I created a “test” directory in the root file of one of my repositories and put the file in it:

 mkdir test echo "abc" > test/x.txt 

I added, locked and pressed. Then I edited .gitignore in the root and added this line:

 x.txt 

I also did the editing for test / x.txt and added a new file:

 echo "123" >> test/x.txt mkdir test2 echo "xyz" > test2/x.txt 

Now when I run "git status", I see:

 modified: .gitignore modified: test/x.txt 

Thus, test2 / x.txt is ignored, but test / x.txt is still being monitored.

To make the file ignore, you can delete it, add and commit the deletion along with the .gitignore change, and then restore the file.

+1
source

Source: https://habr.com/ru/post/1243164/


All Articles