Can I disable opening/closing files on branch switch ?

Answered

I'm often working with temporary branches for experimental stuff. And I often rebase them and of course there are lots of branch switches between them and my current development main branch.

Although I already have disabled the "Task Management" plugin, I get still some kind of task handling, namely the set of opened files changes on every branch switch. What makes it worse is that I don't get exactly the opened files I had when I was at that branch last time, but something from a few days ago. So I'm constantly closing and opening files, and finding the last cursor position.

For my purpose, this remaining task management is more an annoyance than helpful.

Is there a way to disable it ?

 

Regards,

Markus

4
10 comments

Hello Markus Näher

It seems that you have "Restore context on branch switching" enabled under Preferences | Version Control | Confirmation
Please disable it and IDE won't re-open files on a branch checkout.

6

Thanks for the reply.

I misunderstood that option. I thought "workspace" was mostly about project structure and things like that.

Currently, my experimental branches have different sets of libraries and/or different versions of the same libraries. Will these changes still be taken into account when I disable this option ?

 

 

 

0

Markus Näher this option controls the way how opened files (tabs in the editor) would behave. If the option enabled, then opened tabs will be preserved once you switch back to the branch. So basically, IDE remembers what tabs where opened on a particular branch. If you disable this feature - IDE won't preserve tabs.
It won't affect files on disk.

Please let me know if there is a misunderstanding from my side.

0

Thank you for the clarification. I think I've got it :-)

0

Is there a way to disable opening/closing files on task switch?

0

Yes, when you switch tasks you switch branches and in Settings | Version Control | Confirmation, you can configure that if you want to restore workspace of  a certain branch under “Restore workspace when switching branches”.  If you disable this, it will not happen. 

0

Dino Letic Yes I have disabled “Restore workspace when switching branches” but files are closed/opened when switching tasks. I have recorded my screen showing this. Is there some way to get this recording to you?

0

Hi,

My bad, I see what you refer to and no, this switch cannot be disabled. It's actually one of the main functionalities of tasks, why do you need it disabled? 

0

Dino Letic I add Jira as a task server in IntelliJ and then use this for creating commit messages against the jira ticket with {id}: {summary}. I find it very useful to have the id (which is the jira ticket number) available so I don't need to go back to jira to check what it is when making a commit.  Also for single commit tickets, the {id}: {summary} normally suffices as the entire commit message which is very useful. I don't know if there is a way to do this without the file opening/closing functionality?

0

Would you mind opening a feature request on our YT explaining your workflow and idea?

We will have a better workflow there and delegate it properly. 

 

0

Please sign in to leave a comment.