-1

How to ignore .Dll,.PDB files while commit to Git using Visual Studio.

enter image description here

Only we are getting conflicts with .Dll files. Also I added .gitignore file. But it not working for .Dll and .pdb files.

Please help me...

Rakesh
  • 411
  • 2
  • 5
  • 15
  • 1
    Possible duplicate of [Make GIT ignore DLL,PDB and similar generate files](https://stackoverflow.com/questions/31543997/make-git-ignore-dll-pdb-and-similar-generate-files) – Huso Nov 07 '17 at 08:03
  • Can you show us your .gitignore file? –  Nov 07 '17 at 08:09
  • how to show that – Rakesh Nov 07 '17 at 08:42
  • it's too lengthy file – Rakesh Nov 07 '17 at 08:42
  • 2
    Possible duplicate of [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – 1615903 Nov 07 '17 at 09:29

1 Answers1

1

It's indeed not a good idea to add binary files in Git, especially if they change often.

To avoid being bothered by it, you should indeed use your .gitignore file. It should contain the following lines:

*.dll
*.pdb

(note that we can use wildcards (*), hence we don't need to specify the name of each file)

In a brand new repo it would be enough. In your case, since you already committed those files, git will likely continue to take them into account, so you should also remove them from git, with the command git rm <your_file.dll>

Long story short: add a commit where you

  • add a .gitignore file
  • remove those binary files
gturri
  • 13,807
  • 9
  • 40
  • 57