Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Branch associated with 'Default Task' in IntelliJ

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?

enter image description here

like image 691
Marc Hauptmann Avatar asked Aug 29 '14 08:08

Marc Hauptmann


People also ask

How do I change the default branch in IntelliJ?

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.

What is a default 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.

Why is default branch Main?

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.


1 Answers

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.

like image 200
kcintrab Avatar answered Sep 24 '22 20:09

kcintrab