Question

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?

Was it helpful?

Solution

Use the exclamation mark.

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

OTHER TIPS

How about using this VS feature?:

VS screenshot

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

Tiny expansion to Alex' answer, the 'Add Ignored File' button might be hidden under the 'Git' submenu.

'Add Ignored File to Source Control' button

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top