Javascript Git 客户端
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3411302/
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
Javascript Git client
提问by Candidasa
Is there a Javascript implementation of Git?
是否有 Git 的 Javascript 实现?
I'm wanting to use HTML5 to create a rich Javascript application and have the idea that I could use git to track changes to the data. So, I'm wondering if there is a javascript implementation of a git client, or maybe some way of controlling a git repository by making POST requests.
我想使用 HTML5 创建一个丰富的 Javascript 应用程序,并有一个想法,我可以使用 git 来跟踪对数据的更改。所以,我想知道是否有 git 客户端的 javascript 实现,或者可能是通过发出 POST 请求来控制 git 存储库的某种方式。
回答by Gord
Check out: https://github.com/danlucraft/git.js
查看:https: //github.com/danlucraft/git.js
A pure js implementation of git in javascript.
在 javascript 中 git 的纯 js 实现。
回答by vanthome
This https://github.com/creationix/js-gitis and will be the future!
这个https://github.com/creationix/js-git是并将是未来!
It is backed by a kickstarter campaign and has a very sound software design.
它得到了一个 kickstarter 活动的支持,并且具有非常完善的软件设计。
Many of the client use-cases such as git clone
have been implemented
许多客户端用例,例如git clone
已经实现
According the answer to my question on the issue tracker [1]. The author also plans to implement parts of the server side stuff to allow you to build a server with it.
根据我对问题跟踪器 [1] 的问题的回答。作者还计划实现服务器端的部分内容,以允许您使用它构建服务器。
回答by jmar777
I guess it depends on what you need, but there's a few related projects out there.
我想这取决于你需要什么,但有一些相关的项目。
The most "robust" implementation I can think of is this oneby the 280North crew (of Cappuccino fame).
最“稳健”的实施,我能想到的是这一个由280North船员(卡布其诺成名)。
There's also some server-side JavaScript projects underway (e.g., http://github.com/ajaxorg/node-github), but that won't run entirely within a browser client.
还有一些服务器端 JavaScript 项目正在进行中(例如http://github.com/ajaxorg/node-github),但它们不会完全在浏览器客户端中运行。
Update(for anyone else who comes across this):
更新(对于遇到此问题的任何其他人):
Please be sure to check out vanthome's answer. Tim Caswell's js-gitproject is well funded and undoubtedly the best answer here at this time.
请务必查看vanthome 的回答。Tim Caswell 的js-git项目资金充足,无疑是目前最好的答案。
回答by sp0rkyd0rky
I just recently wrote a Git client called Nougit. Maybe this resembles something you are looking for?
我最近写了一个名为 Nougit 的 Git 客户端。也许这类似于您正在寻找的东西?
$ npm install nougit
$ npm 安装牛轧糖
https://github.com/gordonwritescode/nougit
https://github.com/gordonwritescode/nougit
This is a full GUI, but the module inside named "git.js" is an API I wrote specifically to do what you are describing. Yank out the file, and you can use express to handle the http routes.
这是一个完整的 GUI,但里面名为“git.js”的模块是我专门编写的一个 API,用于执行您所描述的操作。拉出文件,您可以使用 express 来处理 http 路由。