0

I have a project and it has a lot of directories containing .dll files. Now I want to ignore all files having .dll extension from all directory. I have .gitignore file in root directory.I tried many combinations but none seems to work.

Please help

Anil Sharma
  • 128
  • 4
  • 19
  • Can we see your gitignore file to see what you have tried. Typically you just add the file type like this `*.dll`. But if you think you have a case sensitive issue (possible) you can try this: `*.[dD][lL][lL]`. – code_fodder Jun 27 '17 at 06:11
  • Try this answer https://stackoverflow.com/questions/1677113/files-to-ignore-when-using-visual-studio-with-git – PAVITRA Jun 27 '17 at 06:14
  • I would agree with PAV, its better to identify the output folders that are created and exclude those since you may want to include some external dll's in your code - I have not used asp.net, but I assume it produces output in the same way as c#/c++ so you probably want to ignore "Debug" and "Release" and/or "Output" folders. – code_fodder Jun 27 '17 at 06:18

2 Answers2

2

Ignoring files From time to time, there are files you don't want Git to check in to GitHub. There are a few ways to tell Git which files to ignore.

Create a local .gitignore

If you create a file in your repository named .gitignore, Git uses it to determine which files and directories to ignore, before you make a commit.

A .gitignore file should be committed into your repository, in order to share the ignore rules with any other users that clone the repository.

GitHub maintains an official list of recommended .gitignore files for many popular operating systems, environments, and languages in the github/gitignore public repository.

  1. In Terminal, navigate to the location of your Git repository.
  2. Enter touch .gitignore to create a .gitignore file.

The Octocat has a Gist containing some good rules to add to this file.

If you already have a file checked in, and you want to ignore it, Git will not ignore the file if you add a rule later. In those cases, you must untrack the file first, by running the following command in your terminal:

git rm --cached FILENAME

Create a global .gitignore

You can also create a global .gitignore file, which is a list of rules for ignoring files in every Git repository on your computer. For example, you might create the file at ~/.gitignore_global and add some rules to it.

  1. Open Terminal.
  2. Run the following command in your terminal:git config --global core.excludesfile ~/.gitignore_global
Rohit Poudel
  • 1,793
  • 2
  • 20
  • 24
1

Just use

*.dll

That will ignore all .dll files recursively, in all folders.

Chris Halcrow
  • 28,994
  • 18
  • 176
  • 206