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

git update gitignore remove files

git rm --cached `git ls-files -i -c --exclude-from=.gitignore`
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 :: Not an editor command: LspInstall 
Shell :: windows open browser from command line 
Shell :: Cannot install windows-build-tools 
Shell :: zsh slow in git repo 
Shell :: valgrind example usage 
Shell :: git submodule push current branch to master 
Shell :: activate virtual environment in ubuntu 
Shell :: pm2 logs log time 
Shell :: docker create image and push 
Shell :: android uninstall application adb 
Shell :: how to install cmake ninja 
Shell :: linux update 
Shell :: how to echo string .sh 
Shell :: The application could not be installed: INSTALL_FAILED_CONFLICTING_PROVIDER 
Shell :: Bash print elements in array 
Shell :: react loaders 
Shell :: brew check installed packages version 
Shell :: onlne compiler c linux 
Shell :: git branch from commit 
Shell :: apt vs apt get 
Shell :: heroku delete branch 
Shell :: powershell allow execution 
Shell :: How to get current git id 
Shell :: recursive grep recursion depth 
Shell :: install git 
Shell :: pip freeze for only project requires 
Shell :: openssl windows 
Shell :: add husky commitlint 
Shell :: delete command from history 
Shell :: where does pip install packages 
ADD CONTENT
Topic
Content
Source link
Name
2+7 =