Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I do an automatic git push in IntelliJ 15?

Currently, I work on a team that does trunk based development.

We moved the project from SVN to GIT recently, which requires me to do a push after every commit (Ctrl+K followed by Ctrl+Shift+K).

Is there a way to configure IntelliJ to push changes to origin/master after every commit?

like image 414
Wojtek Avatar asked Mar 19 '16 20:03

Wojtek


People also ask

How do I push in IntelliJ?

Do one of the following: To push changes from the current branch press Ctrl+Shift+K or choose Git | Push from the main menu. To push changes from any local branch that has a remote, select this branch in the Branches popup and choose Push from the list of actions.

How commit and push your code in Git using IntelliJ?

Alternatively, you can use ⌘K (macOS), Ctrl+K (Windows/Linux) to commit your changes, or ⌥⌘K (macOS), Ctrl+Shift+K (Windows/Linux) to commit and push your changes. If you commit and push your changes you will be able to select your remote repository in the next step.

Where do I put Git commands in IntelliJ?

Select the files you want to add to Git or the entire changelist and press Ctrl+Alt+A or choose Add to VCS from the context menu. You can also add files to your local Git repository from the Project tool window: select the files you want to add, and press Ctrl+Alt+A or choose Git | Add from the context menu.


2 Answers

There is no option to always perform commit and push automatically. However, there is a shortcut to perform these two operations together manually. If you hover over the "Commit" button in the Commit Changes dialog, you'll see the "Commit and Push" option, which will push the changes after you commit them.

like image 128
yole Avatar answered Sep 28 '22 05:09

yole


if i work in Windows 10 with PhpStorm 2018.1 EAP, then i using this script for AutoHotkey Version 1.1.28. for commit and push with just one shortcut (Ctrl+K).

#IfWinActive,ahk_class SunAwtFrame
  ~^k:: ; thats Ctrl+K
    WinWaitActive,Commit Changes ahk_class SunAwtDialog,,3
    Sleep,300
    send,{CtrlDown}{Altdown}k{Ctrlup}{Altup} ; Ctrl+Alt+K that commits and pushes 
    WinWaitActive,Push Commits ahk_class SunAwtDialog,,3 
    Sleep,200
    send,{Altdown}p{Altup} ; push
    Msgbox,macro for git push in IntelliJ finished `n developed:SL5net, 23.03.2018 17:11`n (%A_LineFile%~%A_LineNumber%) 
  return

installer for autohotkey : https://autohotkey.com/download/

like image 44
SL5net Avatar answered Sep 28 '22 03:09

SL5net