简体   繁体   中英

Git ignore disable for certain file

I have a visual studio project and i add .ignore file for visual studio ignore file from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

When i commit file it ignore all dll from bin folder but i need to upload some necessary dll file to repo . How can i achieve this.

Not ignore file like

AjaxControlToolkit.dll 
CKEditor.NET.dll
CLRIntegration.dll

If you really need to have these dll files part of your version control, then you can use git add --force to add them to your Git tracking list, eg

git add --force AjaxControlToolkit.dll

This assumes that the three dll files you listed above are currently in the Visual Studio .gitignore file you mentioned above.

Append this to your .gitignore file.

# bin folder being ignored in the gitignore
[Bb]in/

# exclude these file
!AjaxControlToolkit.dll 
!CKEditor.NET.dll
!CLRIntegration.dll

It will exclude these files from being ignored.

You likely have your bin directory in a directory that is included in the .gitignore . Analyze your directory structure and the contents of .gitignore to figure out which it is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM