简体   繁体   English

如何使用键盘快捷键从 IntelliJ IDEA 执行 git commit 和 push?

[英]How can I use keyboard shortcuts to do a git commit and push from IntelliJ IDEA?

I'm aware that Cmd + K (on macOS) will bring up the Git commit dialog, but I can't figure out how to do a commit and then a push without switching to my mouse.我知道Cmd + K (在 macOS 上)会显示 Git 提交对话框,但我不知道如何在不切换到鼠标的情况下进行提交和推送。

Can anyone provide any guidance here?任何人都可以在这里提供任何指导吗?

On Windows, Alt + P acts as an accelerator for the "Commit and Push" commit button option.在 Windows 上, Alt + P充当“提交并推送”提交按钮选项的加速器。 On Mac it is Cmd Option P .在 Mac 上是Cmd Option P

Another option is to just do the commit from the commit dialog using the default "commit" option.另一种选择是使用默认的“提交”选项从提交对话框中进行提交。 Then when it is done open the VCS Quick Menu ( Alt Backquote (`) for windows; Ctrl + V on Mac) and then do the push from there, either by number or narrowing down via inline search for "push"然后当它完成后打开 VCS 快速菜单( Alt Backquote (`) for windows; Ctrl + V在 Mac 上),然后从那里按数字或通过内联搜索缩小范围缩小“推”

在提交对话框中,按选项shift return 调出选项,然后返回提交。

After analyzing all these answers above, I wasn't satisfied and I found following solution:在分析了以上所有这些答案后,我并不满意,我找到了以下解决方案:

  1. Open commit dialog Cmd + K .打开提交对话框Cmd + K
  2. Type your commit message.输入您的提交消息。
  3. Switch to commit button Tab切换到提交按钮Tab
  4. Press button Space按下按钮空间

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM