Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

remove files inside .gitignore files

# First solution
$ git rm -r --cached . # We remove
$ git add . # We stage
$ git commit -m "Clean up ignored files" # We commit



# Second solution : if you have a lot of files
# It's basicaly the first solution in one line
git rm --cached `git ls-files -i -c --exclude-from=.gitignore`

# If you are on Windows and the line above didn't work, try this one in Powershell
git ls-files -i -c --exclude-from=.gitignore | %{git rm --cached $_}
Comment

git remove all files from gitignore

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

// works with windows powershell
Comment

git remove all files in gitignore

git ls-files -i -z --exclude-from=.gitignore | xargs -0 git rm --cached
Comment

remove gitignore files

git ls-files --ignored --exclude-standard -z | xargs -0 git rm --cached
git commit -am "Remove ignored files"


// answer from: thSoft
Comment

delete gitignore files

git rm -r --cached . 
git add .
git commit -am "Drop ignored files"
Comment

PREVIOUS NEXT
Code Example
Shell :: convert pem to crt 
Shell :: how to delete a branch in github 
Shell :: add gpg key to zsh .zprofile 
Shell :: where skype saves file in linux 
Shell :: how to delete prerouting rule in linux 
Shell :: linux exit file path 
Shell :: remove debian gnu/linux - continue with install process 
Shell :: bash string starts with 
Shell :: get jq command 
Shell :: how to install node.tar.xz in ubuntu 
Shell :: run cron once a day 
Shell :: node-gyp rebuild 
Shell :: nvm how to install specific version of node 
Shell :: git prune remote branches 
Shell :: restart wsl2 windows 
Shell :: ubuntu exec how to exit 
Shell :: powershell disk space 
Shell :: vs code on ubuntu 20.04 and delete old version 
Shell :: python.h missing 
Shell :: how to access docker container bash 
Shell :: install jq in windows 
Shell :: install android studio on linux mint 
Shell :: ubuntu open with code 
Shell :: linux pfx to pem 
Shell :: asdf local 
Shell :: change history editor 
Shell :: copy first 10 lines of a file to another file in unix 
Shell :: bash script template 
Shell :: Could not install Visual Studio Build Tools. 
Shell :: how to pull branch from github 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =