How to work (checkout) on more than one GIT branch at a time?

I'm using GIT and have many branches and need to work on several simultaneously, specifically files in one branch are not in another, and constantly having to

  • check out branch a
  • work on it
  • make a commit

  • check out branch b
  • work on it
  • make a commit

  • recheck out branch a
  • work on it
  • make an updated commit (to revise the first commit and avoid hundreds of intermediate commits)

  • etc.

is becoming very tiresome.

Surely there's a smarter way to work on more than one branch at a time?

I read that git has a worktree feature that supposedly helps. I read here:

https://blog.jetbrains.com/idea/2016/02/intellij-idea-16-eap-improves-debugger-and-adds-git-worktree-support/

worktrees are supported, but I can't find anything in the PHPStorm documentation, forums or knowledge base on how to use GIT worktrees and/or how to work on more than one branch at a time.

Thanks

 

0
3 comments

Yes I had checked that page and am using a multi-rooted project now, but I was wondering about worktrees.

Are they different from multi-rooted projects and if so, does PHPStorm support worktrees?

0

Unfortunately there's no documentation for worktrees & I haven't tested this myself. Please check following SO question: https://stackoverflow.com/questions/36438333/how-do-i-use-git-worktrees-in-intellij-idea-2016-1

0

Please sign in to leave a comment.