目前,我所在的团队采用主干开发模式。
我们最近将项目从SVN
迁移到了GIT
,这要求我在每次提交后进行推送(按下Ctrl+K,然后按下Ctrl+Shift+K)。
是否有一种方法可以配置IntelliJ,在每次提交后将更改推送到origin/master?
目前,我所在的团队采用主干开发模式。
我们最近将项目从SVN
迁移到了GIT
,这要求我在每次提交后进行推送(按下Ctrl+K,然后按下Ctrl+Shift+K)。
是否有一种方法可以配置IntelliJ,在每次提交后将更改推送到origin/master?
#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
AutoHotkey的安装程序:https://autohotkey.com/download/
没有一直自动执行提交和推送的选项。但是,有一个手动执行这两个操作的快捷方式。如果你在“提交更改”对话框中悬停在“提交”按钮上,你会看到“提交并推送”选项,在你提交后会推送这些更改。
项目文件夹/.git/hooks
。
添加名为post-commit
的文件。
在文件中添加以下内容:#!/bin/sh
git push
#!/bin/sh
git push master origin
Commit
即可。