Switch Git branches automatically when switching tasks?

Is there a way to set this up in PHPStorm?

I'm using Jira as the issue tracker and there's a naming convention that Git branches should have the same name as Jira ticket codes. I'd like PHPStorm to automatically switch to a corresponding Git branch when I switch the active task.

Currently I have to switch the Git branch manually every time. The problem is that if some files are open for in the editor and they're missing in the branch to which we're switching, corresponding editor tabs are closed. Doesn't matter what I do first, switch the task or the Git branch, under certain circumstances file tabs disappear and it's very annoying. Kinda defeats the purpose of managing tasks in PHPStorm.

Thank you.

Please sign in to leave a comment.