Visual Studio Team Explorer - View Git Commands

前端 未结 3 775
清酒与你
清酒与你 2020-12-17 16:26

New versions of Visual Studio Team Explorer has built in support for Git.

I want to know if there is an option to view the Git commands executed while using the Team

相关标签:
3条回答
  • 2020-12-17 16:56

    Edit: VisualStudio no more use libgit2sharp but use pure git commands but that changes nothing to the fact that you can't see the commands run.

    No, there is no option to do that. And that seems quite impossible because Visual Studio don't run git commands but use the library libgit2sharp to manage the git repositories.

    If you use the git GUI 'GitExtensions', there is a possibility to see all the git commands run (but unfortunately, that is difficult to understand because the GUI run a lot of commands).

    0 讨论(0)
  • 2020-12-17 17:05

    Git has a number of traces embedded which you can turn on by use git's tracing environment variables. To enable basic general logging:

    1. Open Command Prompt
    2. Run setx GIT_TRACE %UserProfile%\git.log
    3. Restart Visual Studio and Execute the git commands.
    4. Examine the git.log file

    To disable logging:

    1. Open Command Prompt
    2. Run setx GIT_TRACE ""
    3. Restart Visual Studio.

    Should you want to do other types of git tracing, you can also turn on other traces at the command line and point them at the same log file:
    Run setx GIT_TRACE_CURL %UserProfile%\git.log
    Run setx GCM_TRACE %UserProfile%\git.log
    etc

    See more environment variable examples at:
    Git Internals - Environment Variables
    and
    How can I debug git/git-shell related problems?

    0 讨论(0)
  • 2020-12-17 17:05

    The official Visual Studio Git tutorial does not mention that feature at all.

    As this uservoice suggestion suggests, going to command-line and repeating the command (when the one done by Visual Studio failed) is the current method to know more about what is going on.

    0 讨论(0)
提交回复
热议问题