Removing a file from git without removing it from local

5 views 2:46 pm 0 Comments June 24, 2018

Many times while doing an initial commit we accidentally adds `.classpath`, `.project` or other unwanted files.
but later on some point of time we want to remove it.

So here are some examples of removing then from git but not from local filestore

Removing single file
[shell]
git rm –cached .classpath
git rm –cached .project
[/shell]

Removing a directory
[shell]
git rm –cached -r .log
[/shell]

after removnig simply commit the changes
[shell]
git commit -m “remove unwanted files from repo”
git push origin master
[/shell]

test

Leave a Reply

Your email address will not be published. Required fields are marked *