暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

GitHub 开源推荐:Git 二次开发库

猿武场 2021-03-30
1844

「 GitHub 开源推荐 」 关注优秀开源项目
  整理 | 猿胖子
  出品 | 猿武场(ID:apesarena)

关注公众号并回复数字「 1024 」加入猿武场微信社群 

在之前的Git系列文章中讲到Git的基本使用,今天给大家带来的如何将Git的功能嵌入我们自己的应用程序中。

libgit2 能做什么?

libgit2 是一个可移植、纯C语言实现的 Git 核心开发包,它致力于为其他程序使用 Git 提供更好的 API。我们可以借助libgit2来编写自定义的 Git 应用。

// libgit2 项目主页
https://libgit2.org
// github 首页
https://github.com/libgit2/libgit2

libgit2已被广泛应用在许多应用程序上,包括GitHub网站,还被应用在Plastic SCM和强大的微软Visual Studio工具箱。


主要功能
  • SHA转换、格式化和缩略词

  • 抽象的ODB后端系统

  • 提交、标签、树和BLOB解析、编辑、blob解析和回写

  • 树遍历

  • revision walking

  • 索引文件(临时区域)操作

  • 引用管理(包括包引用)

  • 配置文件管理

  • 高级仓库管理

  • 线程安全和可重入

  • 错误信息描述非常详细

  • 更多(超过175个不同的API调用)

语言绑定

目前,可以绑定到libgit2的语言有,并附上各个语言的绑定方法:

  • C++:https://projects.kde.org/projects/playground/libs/libqgit2/

  • Chicken Scheme:https://wiki.call-cc.org/egg/git

  • D:https://github.com/AndrejMitrovic/dlibgit

  • Delphi:https://github.com/libgit2/GitForDelphi

  • Erlang:https://github.com/carlosmn/geef

  • Go:https://github.com/libgit2/git2go

  • GObject:https://live.gnome.org/Libgit2-glib

  • Haskell:https://github.com/fpco/gitlib

  • Lua:https://github.com/libgit2/luagit2

  • .NET https://github.com/libgit2/libgit2sharp

  • .NEThttps://github.com/txdv/libgit2net

  • Node.js:https://github.com/libgit2/node-gitteh

  • nodegit:https://github.com/tbranyen/nodegit

  • Objective-C:https://github.com/libgit2/objective-git

  • OCaml:https://github.com/burdges/libgit2-ocaml

  • Parrot Virtual Machine:https://github.com/letolabs/parrot-libgit2

  • Perl:https://github.com/ghedo/p5-Git-Raw

  • PHP:https://github.com/libgit2/php-git

  • Python:https://github.com/libgit2/pygit2

  • Ruby:https://github.com/libgit2/rugged

  • Vala:https://github.com/apmasell/vapis/blob/master/libgit2.vapi


借助libgit2库,我们可以实现在PC、安卓、IOS等桌面和移动平台的应用程序嵌入Git的功能实现。更多关于liggit2 的API及使用请移步Github了解。


项目地址:https://github.com/libgit2/libgit2


注公众号并回复数字「 1024 」加入猿武场微信社群 

欢迎加入程序员社群,更多技术摘要等你拿走

社群福利:

1. 行业大牛技术手札,知识点汇总

2. 求职/招聘信息内推

4. 人际交往,增强技术宅人际交流;

5. 调节繁杂无趣的闲暇时光;

6. 不定期线上周边线下技术活动沙龙


代 / 码 / 改 / 变 / 世 / 界
感谢您对猿武场的关注与支持
文章转载自猿武场,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论