I am trying to ignore all files and subdirectories from the directory .config
that is located at the root of the repository except the file .config/vimb/config
and the subdirectory .config/ranger/
.
This is my .gitconfig
:
# Ignore the contents of .config
.config/*
# Avoid Blocking
!.config/
!.config/vimb
!.config/vimb/config
!.config/ranger/
As a result git seems to ignore the entire directory event the files and subdirectories that are maked with the !
wildcard.
For a record I also tried the following:
# Ignore Everything
*
# Add files
!somefile1
!somefile2
# Ignore Config
.config/*
# Avoid Blocking
!.config/
!.config/vimb
!.config/vimb/config
!.config/ranger/
Also, I attempted ignoring everything and using !
to add each individual file and directory to be staged.
As of now, I used the following sources to resolve the issue:
Thanks for your help in advance.