Last Updated: July 19, 2020
·
6.164K
· sgtom42

GIT: Remove file from repository and keep it locally

First of all I should tell myself again and again:

"You must not commit your .project and .classpath files!"

But it happens all the time, even though I am sure those files are already added to .gitignore.

Anyway the solution to fix this luckily is simple and will be shown in the following using .project as an example.

git rm --cached .project
git commit -m "Removing files accidently committed"
git push

1 Response
Add your response

Thanks a lot, very good hint ... there is always something to learn on GIT :).

over 1 year ago ·