Answers for "gitignore exclude all file of a folder"

7

git ignore all files within a directory

# Create .gitignore inside the target folder and add the content below

# Ignore everything in this directory
*
# Except this file
!.gitignore
Posted by: Guest on May-06-2021
1

git remove all files from gitignore

git ls-files -i --exclude-from=.gitignore | %{git rm --cached $_}

// works with windows powershell
Posted by: Guest on April-15-2021
1

git remove all files in gitignore

git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached
Posted by: Guest on March-13-2020
3

gitignore all files and folders in only one folder

*
*/
!.gitignore
Posted by: Guest on December-05-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language