gitvisual-studio-codeversion-control

How to see all the background git commands VS code executing when we use GUI options?


I've been using the Git integration in Visual Studio Code (VS Code) extensively, and I'm curious to know the exact Git commands that are being executed under the hood when I use the Git GUI options (like commit, push, pull, etc.).

Is there a way to view these Git commands in real-time as they are executed by VS Code? Is there any built-in feature, a VS Code extension, or any external tool that can help inspect and log these Git commands.


Solution

  • Open the VS Code terminal by Crtl+` or View-Terminal on the main menu. Press the tab "OUTPUT". Select "git" in the top-right select box of the terminal. The Git commands under the hood are printed. It outputs more commands than the the Git GUI option you use.

    The printed lines are more like logs than real executable commands. They are not wrapped properly. There are issues like lack of quotes, and usage of absolute paths. If you copy and paste them in git-bash, CMD, or PowerShell and run them without modification, some of them raise errors.