How to delete. Idea folder from git warehouse

Time:2021-4-6

If the. Gitignore file is not configured, unnecessary files will be pushed to the remote warehouse, such as. Idea file, when push code is used. If this file appears accidentally in the remote warehouse, you can delete it through the following steps:

1. Configure. Gitignore file (New / Edit)


echo '.idea' >> .gitignore

2. Upload the. Gitignore file to the remote warehouse


git pull git add .gitignore git commit -m 'edit .gitignore' git push origin master

3. Delete git’s. Idea file


git rm --cached -r .idea

4. Synchronize to remote warehouse


git commit -m 'delete .idea' git push origin master

After completion, you can find that the. Idea file in Git warehouse has been deleted, and the push code will not upload the. Idea file later.

PS: I’m using pychar to write Python code, usually throughnew -> .ignore file -> .gitignore fileAutomatically generate. Gitignore file.

The following is a brief configuration of. Gitignore file that I often use:


.project .settings/ .prefs .pydevproject .idea/ .idea .DS_Store .cache *.pyc *.html *.xlm

So far, this article about how to delete the. Idea folder from git warehouse is introduced. For more information about deleting the. Idea folder from git warehouse, please search previous articles of developer or continue to browse the following related articles. I hope you can support developer more in the future!