微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

GitSharp .NET的Git开发包

程序名称:GitSharp

授权协议: BSD

操作系统: Windows

开发语言: C#

GitSharp 介绍

GitSharp 是 .NET 框架和 MONO 实现的
Git,旨在完全兼容 Git,也可作为轻量级的开发库为那些需要 Git 特性的应用以及访问
Git 资料库。

示例代码

//opening an existing git repository
repo = new Repository(“path/to/repo”);

// Now suppose you have created some new files and want to commit them
repo.Index.Add(“README”, “License.txt”);
Commit commit = repo.Commit(“My first commit with gitsharp”, new
Author(“henon”, "[email protected]”));

// Easy, isn’t it? Now let’s have a look at the changes of this commit:
foreach (Change change in commit.Changes)
Console.WriteLine(change.Name + ” ” + change.ChangeType);

//Get the staged changes from the index
repo.Status.Added.Contains(“README”);

//Access and manipulate the configuration
repo.Config[“core.autocrlf”] = “false”;

GitSharp 官网

https://github.com/henon/GitSharp

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐