Skip to content
forked from christkv/node-git

A node.js git implementation modeled on ruby-git

Notifications You must be signed in to change notification settings

quafzi/node-git

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

build status

Introduction

This is a library for Git written in Node.js. It's as close a port of grit http://github.com/mojombo/grit.

The idea is to allow for manipulation of git repositories by the node.js application. Not everything is implemented directly in node-git. Some of the stuff is using the native git command line instead of direct javascript code. Also it's fairly synchronous right now but that will hopefully change a little by little over time as it gets more stable and I start using it in real life scenarios.

Github information

The source code is available at http://github.com/christkv/node-git. You can either clone the repository or download a tarball of the latest release.

Once you have the source you can test the driver by running

$ make test

On windows:

PS > node.exe .\node_modules\nodeunit\bin\nodeunit .\test

Examples

To get the history of a repository:

// init repository
new git.Repo(
  '/path/to/your/repo',
  {is_bare: true}, // you may use this to access a bare repository
  function (repo) {
    repo.log(null, null, {}, function(history) {
      // history is an array of commits, containing
      // * id
      // * sha
      // * parents
      // * tree
      // * author
      // * authored_date
      // * committer
      // * committed_date
      // * short_message
      // * filechanges
    });
  }
);

For more examples of usage look at the tests included in the repository.

Notes

The current version is basic git support, don't expect everything to work as you expect it off the bat.

License

Copyright 2009 - 2010 Christian Amor Kvalheim.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.

About

A node.js git implementation modeled on ruby-git

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.3%
  • Ruby 0.7%