1

How do I invoke the commit input message box from the Source Control View (using one command/shortcut)? git.commitall invokes a floating commit message window.

enter image description here

The reason I want the one in the Source Control is that it provides the commit history with arrow keys and also shows you the changes underneath.

4
  • so you want that one with the git.commitall command? Or you just want whatever keyboard shortcut will focus that one?
    – starball
    Commented Jul 29, 2023 at 19:20
  • @starball i want the green one with whatever keyboard shortcut, idk which command invokes it, otherwise i'd just use it
    – cppbest
    Commented Jul 30, 2023 at 8:24
  • I have moved my answer post here, since I do not want to have the appearance of double-dipping for reputation (unless someone copies my answer from there back to here under CC-BY-SA (in that case I want to take credit)). I will vote to close this question as a duplicate once the bounty period has ended.
    – starball
    Commented Aug 11, 2023 at 22:58
  • @starball finally! The answer that works! Thank you!
    – cppbest
    Commented Aug 12, 2023 at 5:01

1 Answer 1

-1
+50
  • You can use the short cut key Ctrl + Shift + G G to open the source control from your active VS Code window.

  • You can also find the list of keyboard shortcuts by pressing the Ctrl + K Ctrl + S (File > Preferences > Keyboard Shortcuts) or you can use the VS Code cheat sheet on web for windows.

  • Additionally, you can provide your own key bindings for commands by editing the commands and specifying your own short-cut key.

Update

How to define your own key bindings?

1- Open the Keyboard Shortcuts by pressing Ctrl + K Ctrl + S

2- Search for command workbench.view.scm or Source Control

3- You can define your own key bindings by either clicking on the edit icon (you'll see edit icon when hover over the row) or double clicking on the Keybindings column cell of specific command (in this case, workbench.view.scm).

4- A popup window will appear with title "Press desired key combination and then press ENTER". Here you can press your desired keys from keyboard, e.g. if I press ctrl + shift + M at once, and, then press enter, it will be my new key binding (keyboard short cut) for source control

enter image description here

9
  • But... I did mention that very same shortcut in my answer. I did not mention the Keyboard Shortcuts, because I did not find any command for that specific view.
    – VonC
    Commented Aug 6, 2023 at 11:50
  • Actually, when I started writing answer, there's no any answer on this post. Any way you can go to the File > Preferences > Keyboard Shortcuts from your main menu for all the keyboard short cuts. Commented Aug 6, 2023 at 12:08
  • 2
    Strange, since I posted my answer 50 minutes before yours ;)
    – VonC
    Commented Aug 6, 2023 at 12:10
  • " I did not mention the Keyboard Shortcuts, because I did not find any command for that specific view.": meaning, there is no command you could find in File > Preferences > Keyboard Shortcuts for you to map a shortcut to that "source control" view.
    – VonC
    Commented Aug 6, 2023 at 12:11
  • So, what command should I keybind?)
    – cppbest
    Commented Aug 7, 2023 at 4:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.