Working in different git branches and eternal indexing
Answered
Hi,
we have 2017.2.6 IntelliJ and we work in different branches of the same project. After changing the branch, Intellij starts reindexing everything, and it usually hangs for a while.
As we have a lot of js files, it keeps indexing/hanging for 15-20 minutes. We tried to exclude the js folder from the project, but then, when we deploy, that folder is not included.
I've read about deleting cache, but I guess we can't be deleting it everytime before changing branches.
The pc is linux, SSD HD and 6GB RAM, so I guess it is not because of that.
Which would be the way of working with it properly?
Thanks
Please sign in to leave a comment.
It is not possible to avoid reindexing on branch switch, however, it should not reindex the entire project, only the files changed by checkout. There is similar request to make index branch-aware - https://youtrack.jetbrains.com/issue/IDEA-79342
Are the .js files you refer to tracked in git and updated via branch switch?
A good workaround could be using git worktrees and checkout branches as separate projects, this will help you avoid unnecessary indexing
Hi,
thanks. Yes, the js files are included only in one branch. I'll checkout the git worktrees and see, but I don't thing we can every branch in a different folder.
Is there any way of exclude the js folder, so that it doesn't index it, and deploy it, as it was included?
Thanks
You could have one work-tree for branches with the js files, and another one for branches without them. This way switching a branch will not lead to reindexing of all those js files.
As for the issue iwth Deployment, AFAIk excluding a folder does not exclude it from Deployment - see https://youtrack.jetbrains.com/issue/WI-23659 and related.
Do you mean another feature?
About working trees, it seems to be a good solution, we'll think about it. Is there any open issue, so that users can exclude folders from being indexed?
About the issue that you wrote, I think it's not exactly what I meant. I was saying that, related to the indexing problem, if we exclude the folder (in module settings), it is not indexed, so we fix the problem, but after that, is not deployed either. We would like to exclude it from indexing but deploy it anyway.
Thanks!
I understand what you mean and the issue I referred to is very similar - it says that it is not possible to exclude from deployment by marking a folder as Excluded in the project tree.
So marking a directory as excluded should not affect Deployment.
Maybe the folder is somehow added to Tools | Deployment | Configuration | Excluded paths?
Also check the path mappings Tools | Deployment | Configuration | Mappings
We have nothing in Tools -> Deployment -> Configuration, but if we exclude the folder in File-> Project Structure -> Modules it is not indexed nor deployed
Please clarify what you mean by Deploy then. Seems we are talking about different features.
I have a local Tomcat, added to Run/debug configurations. Inside the configuration, there is a tab called "Deployments". It is there that I add my project to be deployed
Any idea? Thanks
Do you select just an external folder in Deployment tab or you are deploying an artifact, produced by IDE? Please attach screenshot of your deployment configuration.
That was the point.
Excluding the folder and adding it as a external deployment did the trick,
Thanks a lot