Reputation: 3
We often use .gitignore
to ignore files or folders.
How can I do the reverse things?
I just want to add specific files &r folders I interest in.
Upvotes: 0
Views: 53
Reputation: 142552
You can do it like this:
Use the !
sign to "not ignore" the required patterns
### This is your git ignore file:
# ignore all files and folders
**/**
# Add any specific required files
!<file/path>
ignore all your files ad use the git add -f
(force flag) to add any required tracked files
### This is your git ignore file:
# ignore all files and folders
**/**
To add the desired files
git add -f <file/path>
Upvotes: 1