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:
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
请先登录再写评论。
Hello,
Did you check that help page?
https://www.jetbrains.com/help/phpstorm/2017.1/git-branches-in-multirooted-projects.html
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?
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