How to Remove .idea Directory from .git

image
Volodymyr Hodiak
January 4, 2020|2 min read|12209 views

How to Remove .idea Directory from .git

If you have accidentally added the .idea directory to .git repository, and you don’t want it to be there, then there is an easy way to remove it. You just have to use the command line and do the following:


# Create file .gitignore
touch .gitignore

# Add .idea to .gitignore
echo '.idea' >> .gitignore

# Remove directory from staging
git rm -r --cached .idea

# Add file to git
git add .gitignore

# Commit changes
git commit -m "Removed .idea from git"

# Push changes
git push
Share

CONTACT US

By submitting this form I consent to processing my personal data as described in thePRIVACY POLICY

We are open to answer you directly

image
image

Serhiy Lavrynenko

Volodymyr Hodiak

CEO

CTO