43

Is there a Javascript implementation of Git?

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.

4
  • 1
    you mean without an intermediate language? like posting to perl and then having perl handle it? Commented Aug 5, 2010 at 2:22
  • 1
    Ideally without an intermediate language, yes. Or, if no such pure javascript git client is available, a service that provides an HTTP interface to git would also be okay. Commented Aug 6, 2010 at 2:57
  • did you find something? I need this as well. Commented Feb 10, 2011 at 9:48
  • Old question with 3 mentioned implementations, that were only active when answer was maid. Commented Aug 6, 2013 at 6:30

5 Answers 5

23

Check out: https://github.com/danlucraft/git.js

A pure js implementation of git in javascript.

Sign up to request clarification or add additional context in comments.

2 Comments

Can write to the repo, currently (and no action there for a year).
Rather outdated, please see my answer below.
18

This https://github.com/creationix/js-git is and will be the future!

It is backed by a kickstarter campaign and has a very sound software design.

Many of the client use-cases such as git clone have been implemented

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.

https://github.com/creationix/js-git/issues/33

1 Comment

This "future" has no significant updates for the last 6 years...
7

You can use https://github.com/isomorphic-git/isomorphic-git

enter image description here

isomorphic-git is a pure JavaScript reimplementation of git that works in both Node.js and browser JavaScript environments. It can read and write to git repositories, fetch from and push to git remotes (such as GitHub), all without any native C++ module

isomorphic-git is a continuation of https://github.com/creationix/js-git

isomorphic-git would not have been possible without the pioneering work by @creationix and @chrisdickinson. Git is a tricky binary mess, and without their examples (and their modules!) I would not have been able to come even close to finishing this. They are geniuses ahead of their time.

Related questions:

  1. Run git push from javascript hosted in static site
  2. How to implement Git in pure Javascript to create a GUI?

Comments

5

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 one by the 280North crew (of Cappuccino fame).

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.


Update (for anyone else who comes across this):

Please be sure to check out vanthome's answer. Tim Caswell's js-git project is well funded and undoubtedly the best answer here at this time.

1 Comment

GitHub client is not implementation of Git
1

I just recently wrote a Git client called Nougit. Maybe this resembles something you are looking for?

$ npm install 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.

5 Comments

Hello! Here on Stack Overflow, link only answers are not considered answers. Unless you flesh it out with some code, your answer is in danger of being deleted per the faq section on deletion, especially "Answers that do not fundamentally answer the question may be removed. This includes answers that are … barely more than a link to an external site". Also, since you're linking to your own GitHub, please see the faq section on promotion as well.
Thanks for the heads up, although I'm a little confused, seeing as how the top voted answer falls under the same exact category you are describing.
Ah, indeed it is. I saw your answer from the Late Answers review queue, so I was judging your answer in isolation. The entire question problem needs to be closed, since it's essentially just a "Shopping Recommendation" question, which are now off-topic network-wide.
Not active for a year
repo delete/private...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.