Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save workspace/state on Git branch switch

Tags:

phpstorm

Using PHPStorm to switch Git branches is great, but it usually throws all of my breakpoints around when there is a large difference between the new branch HEAD and the old one. Is there a way to snapshot what files were open and what lines had breakpoints on them?

When closing PHPStorm and re-opening it, those values are saved. Is there a way to leverage that same information on switching Git branches?

like image 288
sailboatlie Avatar asked Oct 17 '25 22:10

sailboatlie


1 Answers

You're looking for Tasks & Contexts (Tools > Tasks & Contexts > Open Task or Switch Task) Windows: Alt-Shift-N for Open, and Alt-Shift-T to Switch.

Open Task will allow you to create a new Task. This will prompt you to create a git branch when you create a new Task. This task will be associated with the branch, and will be automatically marked as closed when you commit. By associating the task with a branch, PhpStorm will automatically switch between branches, along with its default task behaviour of closing/opening task-relevant files. This should preserve your breakpoints.

like image 124
Noah Avatar answered Oct 19 '25 11:10

Noah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!