如何调用 git-fetch from Visual Studio 分机?
How to call git-fetch from Visual Studio Extension?
我正在开发自定义 VS 扩展,它将向 Visual Studio 中的 git 源代码控制插件添加更多 UI。 UI 完成。
Visual Studio SDK 中是否有一些 API 可用于调用 git 相关命令(例如 git fetch)或检索 git 相关设置,例如存储库 url?
您可以使用 Process 通过 C# 代码调用 git 命令。请参考下面的示例代码。
string gitCommand = "git";
string gitAddArgument = @"add -A" ;
string gitCommitArgument = @"commit ""explanations_of_changes"" "
string gitPushArgument = @"push our_remote"
Process.Start(gitCommand, gitAddArgument );
Process.Start(gitCommand, gitCommitArgument );
Process.Start(gitCommand, gitPushArgument );
您也可以尝试使用 LibGit2Sharp NuGet 包,它是本机 Git 实现。关于如何在C#中使用,请参考下面的博客。
http://blog.somewhatabstract.com/2015/06/22/getting-information-about-your-git-repository-with-c/
我正在开发自定义 VS 扩展,它将向 Visual Studio 中的 git 源代码控制插件添加更多 UI。 UI 完成。
Visual Studio SDK 中是否有一些 API 可用于调用 git 相关命令(例如 git fetch)或检索 git 相关设置,例如存储库 url?
您可以使用 Process 通过 C# 代码调用 git 命令。请参考下面的示例代码。
string gitCommand = "git";
string gitAddArgument = @"add -A" ;
string gitCommitArgument = @"commit ""explanations_of_changes"" "
string gitPushArgument = @"push our_remote"
Process.Start(gitCommand, gitAddArgument );
Process.Start(gitCommand, gitCommitArgument );
Process.Start(gitCommand, gitPushArgument );
您也可以尝试使用 LibGit2Sharp NuGet 包,它是本机 Git 实现。关于如何在C#中使用,请参考下面的博客。
http://blog.somewhatabstract.com/2015/06/22/getting-information-about-your-git-repository-with-c/