Git submodule branch automatically changes to parent branch
PHPStorm started doing this some time ago. A year? Two years? I can't remember but I have lived with it but with headaches
1. I clone a project and set it up in phpstorm.
2. I go to a directory within my project scope and manually clone a second project via terminal pane that my project will depend on.
3. If I create a new branch on the main project the second project is automatically put on a branch with the same name which I don't want. I want the submodule unchanged unless I specifically change it's branch.
4. Within the Git project interface for phpstorm it shows the two projects as one, for instance it will say BranchName (Project, Subproject). These used to be listed separately and I could commit each one independently. Project could be on branch Testing, submodule could be on branch Production.
How do I get it back to the way it used to work? If I wanted to branch the subproject I had to specify directly. If the main project was branched, or a new branch was checked out on the main project the subproject would remain on whatever branch it was originally on and it would stay that way unless I directly checked out a different branch or created a new branch on the subproject.
How do I get phpstorm setup the way it was? Or how do I get it setup so that these two projects aren't seemingly linked together from the perspective of git?
请先登录再写评论。
Hi,
In Settings | Version Control | Git, please disable “Execute branch operations on all roots” option.
Is it working fine after that?