windows 是否有适用于 GIT(C++ 或其他语言)的 API

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7616482/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 18:11:08  来源:igfitidea点击:

is there an API for GIT (C++ or other languages)

c++windowsgitwinapi

提问by Draconar

A company asked me to program a GIT wrapper for them.

一家公司让我为他们编写一个 GIT 包装器。

The people there have absolute no versioning systems experience, but it will be incorporated in their daily routine eventually (through my program).

那里的人绝对没有版本控制系统的经验,但它最终会被纳入他们的日常工作(通过我的程序)。

I'm planning on using VC++ to create a tiny windows applet that will help ppl in this process. Any thoughts on that?

我计划使用 VC++ 来创建一个小窗口小程序,它将在此过程中帮助 ppl。对此有何想法?

What about a Deamon process checking if people want to commit/push their files?

一个守护进程检查人们是否想要提交/推送他们的文件呢?

回答by Ana Betts

For almost (but not all!) use cases, libgit2is the easiest way to interact with Git repositories via code.

对于几乎(但不是全部!)用例,libgit2是通过代码与 Git 存储库交互的最简单方法。

回答by Ben Hymanson

Git already has two layers: The plumbing (which you may be interested in) on top of which is built the primary porcelainwhich provides the user interface. If you want to implement something like git-commitbut with slightly different semantics all of the underlying programs like git-write-treeand git-rev-parseare there for you to build on.

Git 已经有两层:管道(您可能感兴趣)在其上构建了提供用户界面的主要瓷器。如果你想实现一些类似git-commit但语义略有不同的东西,所有的底层程序都喜欢git-write-tree并且git-rev-parse可以在那里进行构建。

See also What does the term "porcelain" mean in Git?

另请参阅Git 中的术语“瓷器”是什么意思?

回答by Ben Voigt

There's already TortoiseGit, among other "friendly" interfaces. Don't re-invent the wheel, start by researching what's already available.

已经有TortoiseGit,以及其他“友好”的界面。不要重新发明轮子,从研究已有的东西开始。

回答by Jean-Marc

In order to easier the search for documentation hereafter the link to the official. It's about the plumbing and porcelain: https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain

为了方便查找文档,以下链接官方。这是关于管道和瓷器的:https: //git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain