1

I'm collaborating on an IntelliJ IDEA project using Git and GitHub. The original creator of the repo added the IntelliJ .idea folder to the repo, and I find it annoying to see changes to IDE files constantly popping up in the commit dialog. The .idea folder is in fact added to .gitignore, but that happened after they were already tracked.

I removed the folder from the local repo using git rm --cached -r -f .idea/, which to my understanding removes the files from the repo.

However, other collaborators still want to be able to commit and push their changes to the .idea folder. So I just want to ignore the .idea folder locally.

The folder and it's contents show up in the commit dialog as deleted right now, and I'm worried that if I commit and push now, it will also affect other collaborators - right? What should I do to just ignore this folder locally but not affect others who still want to be able to commit and push their changes to the folder? Is this even possible?

2
  • 1
    Use skip-worktree feature: stackoverflow.com/a/13631525/717372 Commented May 20, 2019 at 13:36
  • @Philippe Thanks, I just found and tried that command, and it worked - although I had to first add back the folder to the repo, and then for some reason run the skip-worktree command on each file inside the .idea folder. Simply running it on the folder seemed to work, but changes still showed up in git status and the IntelliJ commit dialog. I found the answer here useful: stackoverflow.com/a/40272289/930640 Commented May 20, 2019 at 13:47

1 Answer 1

3

Try git update-index --skip-worktree [file].

As pointed out in the comments, this answer provides more insight.

Sign up to request clarification or add additional context in comments.

2 Comments

Once again, bad use of ` assume-unchanged` (for perf). Should be skip-worktree (to ignore locally): stackoverflow.com/a/13631525/717372 I don't know why most people are wrong on most of the stackoverflow answers...
Oh.. That's right. My bad! Updating the answer with correct info.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.