3
votes

I'm using the standard Visual Studio .gitignore at https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

Part of that gitignore is to ignore the bin folders, but this is a problem, because I need to include bin/*.refresh files for visual studio web site projects.

When one has a (local file) web site project in: C:\Projects\MyprojectA\MyProjectWeb then any references to libraries are stored as "hint files" in the C:\Projects\MyprojectA\MyprojectWeb\bin folder as *.refresh.

So if you reference (a non framework DLL) AjaxControlToolkit.dll, so in the bin folder, you end up with AjaxControlToolkit.dll and AjaxControlToolkit.dll.refresh. The content of the file indicates the path of where to find that DLL. (Let's ignore the potential pathing problems when the repo is cloned, because we're checking in the DLLs into a _lib folder that's also checked into the repo)

How does one "unignore" the *.refresh files found within Visual Studio Web Site project bin folders so that they are included with clones of the repo?

3
Adding a reference to .gitignore syntax, in case you (like I) did not know the meaning of ** in the answers below. git-scm.com/docs/gitignoreqxotk

3 Answers

2
votes

Use the exclamation mark.

**/[Bb]in/*
!**/[Bb]in/*.refresh
2
votes

How about using this VS feature?:

VS screenshot

1
votes

Once folders are excluded they can't be un-excluded. Do it this way to include sub-folders like roslyn.

replace

[Bb]in/

with

**/[Bb]in/**/*.*
!**/[Bb]in/**/*.refresh