Reputation: 89
I can exclude single files from my git commit but I want to exclude all files which have .exe
file type.
Upvotes: 5
Views: 11142
Reputation: 11
You can simply make a .gitignore file in your git initialised folder
touch .gitignore
You can open that gitignore file with any of text editor and write *.exe
to ignore the .exe file from adding to the version control . If already .exe is being commited you can simply delete it and make a new commit
Upvotes: 0
Reputation: 1043
you can use regex as a pattern in the git ignore file as bellow:
# Ignore all
*
# Unignore all with extensions
!*.*
# Unignore all dirs
!*/
### Above combination will ignore all files without extension ###
# Ignore files with extension `.class` & `.exe`
*.class
*.exe
# Ignore `bin` dir
bin/
# or
*/bin/*
# Unignore all `.exe` in `bin` dir
!*/bin/*.exe
Upvotes: 6