简体   繁体   English

Visual Studio Team Explorer - 查看 Git 命令

[英]Visual Studio Team Explorer - View Git Commands

New versions of Visual Studio Team Explorer has built in support for Git.新版本的 Visual Studio Team Explorer 内置了对 Git 的支持。

I want to know if there is an option to view the Git commands executed while using the Team explorer for Git actions like Commit and Push.我想知道是否有一个选项可以查看在使用团队资源管理器执行 Git 操作(如 Commit 和 Push)时执行的 Git 命令。

Also would be better to have an option to view the other commands executed by Team Explorer like fetching status.最好有一个选项来查看团队资源管理器执行的其他命令,例如获取状态。

Are those features available with the current Visual Studio?当前的 Visual Studio 是否提供这些功能?

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. 编辑:VisualStudio不再使用libgit2sharp但使用纯git命令,但这不会改变您无法看到命令运行的事实。

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. 这似乎是不可能的,因为Visual Studio不运行git命令,而是使用库libgit2sharp来管理git存储库。

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). 如果你使用git GUI'GitExtensions',就有可能看到所有的git命令都运行(但不幸的是,这很难理解,因为GUI运行了很多命令)。

Git has a number of traces embedded which you can turn on by use git's tracing environment variables. Git嵌入了许多跟踪,您可以使用git的跟踪环境变量打开它们。 To enable basic general logging: 要启用基本常规日志记录:

  1. Open Command Prompt 打开命令提示符
  2. Run setx GIT_TRACE %UserProfile%\\git.log 运行setx GIT_TRACE %UserProfile%\\git.log
  3. Restart Visual Studio and Execute the git commands. 重新启动Visual Studio并执行git命令。
  4. Examine the git.log file 检查git.log文件

To disable logging: 要禁用日志记录:

  1. Open Command Prompt 打开命令提示符
  2. Run setx GIT_TRACE "" 运行setx GIT_TRACE ""
  3. Restart Visual Studio. 重新启动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: 如果要进行其他类型的git跟踪,还可以在命令行打开其他跟踪并将它们指向同一个日志文件:
Run setx GIT_TRACE_CURL %UserProfile%\\git.log 运行setx GIT_TRACE_CURL %UserProfile%\\git.log
Run setx GCM_TRACE %UserProfile%\\git.log 运行setx GCM_TRACE %UserProfile%\\git.log
etc 等等

See more environment variable examples at: 查看更多环境变量示例:
Git Internals - Environment Variables Git Internals - 环境变量
and
How can I debug git/git-shell related problems? 如何调试git / git-shell相关问题?

The official Visual Studio Git tutorial does not mention that feature at all. 官方Visual Studio Git教程根本没有提到该功能。

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. 正如这个uservoice建议所示,进入命令行并重复命令(当Visual Studio完成的命令失败时)是当前的方法,可以更多地了解正在发生的事情。

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

相关问题 更改 Visual Studio Team Explorer 的 GIT 帐户 - Change GIT account of Visual Studio Team Explorer Git - 在 Team Explorer Visual Studio 上撤消提交 - Git - Undo a commit on Team Explorer Visual Studio Visual Studio Team Explorer失去了Visual Studio Online的Git授权 - Visual Studio Team Explorer lost Git authorization for Visual Studio Online 团队资源管理器+ Visual Studio Online + Git不同步 - Team Explorer + Visual Studio Online + Git out of sync 是否可以恢复在 Visual Studio -> Team Explorer -> Git 中所做的撤消更改? - Is it possible to revert the undo changes done in Visual Studio -> Team Explorer -> Git? 在Team Explorer中为Visual Studio 2013选择GIT MERGE的选项在哪里? - Where is the option to do a GIT MERGE in Team Explorer for Visual Studio 2013? Visual Studio Team Explorer-GIT:自动忽略新文件 - Visual Studio Team Explorer - GIT: Automatically ignoring new files Visual Studio 2013团队资源管理器/ Git集成缺少文件 - Visual Studio 2013 Team Explorer/Git integration missing files 命令行中的Visual Studio Team Explorer和git显示不同的状态 - Visual Studio Team Explorer and git in command line shows different status Visual Studio:Git 团队资源管理器未显示任何更改 - Visual Studio: Git Team Explorer does not show any changes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM