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 :: rm all except 
Shell :: add address to path cmd windows 
Shell :: bind failed address already in use mac 
Shell :: apache/2.4.41 (ubuntu) server at localhost port 80 error 
Shell :: linux mint package manager 
Shell :: uninstall lubuntu 
Shell :: windows get hostname from ip 
Shell :: awk lowercase 
Shell :: windows 10 openssh server install failed 
Shell :: saml2aws logout 
Shell :: extract bz2 linux 
Shell :: resize image linux command line 
Shell :: powershell output to file 
Shell :: ubuntu kill specific port 3000 
Shell :: TypeError: lookups.flatMap is not a function 
Shell :: docker remove not running containers 
Shell :: ip config ubuntu 
Shell :: Unable to init server: Could not connect: Connection refused 
Shell :: connect ps4 controller to pc linux 
Shell :: grep specific file 
Shell :: font manger for arch 
Shell :: how to git merge with specific commit 
Shell :: ssh copy from remote to local 
Shell :: vim save read only file 
Shell :: install vue in laravel 
Shell :: git checkout new branch with uncommitted changes 
Shell :: discard unstaged changes git 
Shell :: aws cli ec2 list security groups 
Shell :: open xampp control panel from terminal ubuntu 20 
Shell :: remove unused images docker manually 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =