简体   繁体   中英

Sequence git pull-commit-push at once in JetBrains products

I would like to be able to do the git pull-commit-push action in 1 shortcut (clicking 1 option) in Android Studio / IntelliJ.

It would be such a convenient solution. Can I do it?

IntelliJ has Commit+Push action, and also could automatically pull if the push is rejected. It is not exactly the same, but quite close.

As Dmitriy said, you can force update on push rejection, see screenshot.

Now, the fastest keyboard shortcut I can think of, assuming you have predefined commit messages in .gitmessages and unchecked all the "Before commit" safety checks, is : ctrl+k for commit, shift+tab twice to put the cursor on commit button, press enter to commit, then ctrl+shift+k for push, the combination shift+tab once, press enter. That's 7 keystrokes.

So you can record this : go to Edit / Macros / Start macro recording / type the keystrokes / go back to Edit / Macros / Stop recording.

Then go to Preferences / Keymap / Macros / right click on your recorded macro and select Add Keyboard shortcut and voila your convenient shortcut.

If you are alone with your code and are fine with a cluttered git history and meaningless commit messages, it answers your question.

在偏好

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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