Our git workflow looks like it is shown in the picture. There is a master
branch for the releases. Development takes place in the develop
branch respectively in feature branches. I connected my IntelliJ (version 13.4.1
) to our ticket system (redmine). So when I open a task, IntelliJ automatically creates a feature branch for me.
When I switch back to the Default Task, IntelliJ checks out the master
branch. However in most cases I want to have the develop
branch checked out, and I have to switch manually. How do I configure IngelliJ (or git) to check out the develop
brach each time I open the Default Task?
In the Log view, select the commit that you want to act as a starting point for the new branch and choose New Branch from the context menu. In the dialog that opens, specify the branch name, and make sure the Checkout branch option is selected if you want to switch to that branch.
About the default branch The default branch is also the initial branch that Git checks out locally when someone clones the repository. Unless you specify a different branch, the default branch in a repository is the base branch for new pull requests and code commits.
For those who may not know, the 'master' branch was the default branch name for any git's fresh repository. Therefore, many people often used it as a stable branch. Spurred by the rise in racism cases across the US, GitHub recently renamed its 'master' branch to 'main'. the company said.
I've found that you can change which branch is associated with a task by editing the .idea/workspace.xml file in your project. Find the task element with an id of Default
. There should be a child branch element. Change its name to the name of the branch that you want tied to the task. So in your case, you should be changing master
to develop
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With