Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pull with rebase by default in IntelliJ Idea?

By company policy, all pulls unless agreed with tech lead must be done with rebase rather than merge.

I use Eclipse and successfully set the default pull mode to rebase to all my branches (despite Eclipse suggests merge as default mode).

My deskmate, working on my same project, uses IntelliJ Idea. Guess what? He always forgets to check pull-with-rebase when pulling, ending up in endless merge commits.

I often have to complain with him for violating the rule I took so long to make a standard, then I need to do force pushing to fix the tree from the mess. Only 2 people here use IntelliJ, other use Eclipse and have no problems with Git.

How do I set the default pull mode in IntelliJ Idea?

like image 841
usr-local-ΕΨΗΕΛΩΝ Avatar asked Mar 31 '17 12:03

usr-local-ΕΨΗΕΛΩΝ


2 Answers

In IntelliJ you can set the default pull strategy in

File -> Settings -> Version Control -> Git

Change it under "Update method". There you can choose "Rebase" instead of "Merge".

like image 151
Nika Avatar answered Sep 30 '22 12:09

Nika


Leave alone IntelliJ IDEA. Run git config --global pull.rebase true in his git bash. Or set this on a per-branch basis, by git config --global branch.<name>.rebase true, which is safer and more flexible.

like image 44
ElpieKay Avatar answered Sep 30 '22 12:09

ElpieKay