Answers for "git remove files from repo but not locally"

2

remove folder from repo but keep locally

git rm -r --cached File-or-FolderName
git commit -m "Removed folder from repository"
git push origin master
Posted by: Guest on July-04-2020
0

git remove remote file keep local

# for single file
git rm --cached myfile

# for directory file
git rm --cached --r myfile
Posted by: Guest on June-25-2020
0

git remove files from repo but not locally

git rm --cached `git ls-files -i -X .gitignore`
Posted by: Guest on March-19-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language