Remove files from master at github
13,208
Use git rm --cached FILENAME
to delete it from the repository but keep the file physically and git add FILENAME
to add a file to your repository. You will need to commit both of these changes with git commit
Author by
danielsvane
Updated on June 21, 2022Comments
-
danielsvane almost 2 years
First time playing with git, and I accidentally added all hidden files with my commit. Now that I have set up my .gitignore, and committed my changes, all the files ending with "~" are still there.
How do I commit my local files, and remove those from master that are not supposed to be there any more?
-
Admin about 12 yearsI didn't know about the
--cached
flag. +1 for that. :) -
danielsvane about 12 yearsIs there any way to remove all untracked/ignored files, so I don't have to manually do this? Gedit creates a hidden file for everything it has opened apparently.
-
QuantumBlack about 12 yearsAre the files spread all over your directory structure? If not, use some GUI utilities like tortoisegit to easily do that.
-
QuantumBlack about 12 yearswindows search to list all your "~" files + tortoisegit = win