github.com/crystal-git/libgit2

Yet another Crystal library for manipulating Git repositories in an object-oriented way.

17 stars
0 dependents
License: MIT

Nothing has been indexed for 0.2.3 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.

Installation

# Add this to your shard.yml
dependencies:
  git:
    github: crystal-git/libgit2
    version: ~> 0.2.3

Then run:

shards install

shard.yml

No shard.yml has been indexed for 0.2.3. You can read it on the repository.

Dependencies

Unknown: the shard.yml for this version has not been read yet.

README

This README is the one indexed from the repository at its latest ref, not from the tag for this version.

# Crystal Git

Yet another Crystal library for manipulating Git repositories in its object-oriented way.

Crystal Git internally wraps libgit2 and provides the similar API.

This project is currently experimental.

[![Build Status](https://travis-ci.org/mosop/git.svg?branch=master)](https://travis-ci.org/mosop/git)

## Installation

Add this to your application's `shard.yml`:

```yaml
dependencies:
  git:
    github: mosop/git
```

<a name="code_samples"></a>
## Code Samples

### Checkout from Remote Branches

```crystal
`git init`
`git remote add origin https://github.com/mosop/git.git`

repo = Git::Repo.open(Dir.current)
repo.remotes["origin"].checkout("master")

puts `git branch` # prints "* master"
```

### Remote URLs

```crystal
`git init`
`git remote add origin https://github.com/mosop/fetch.git`
`git remote set-url --push origin https://github.com/mosop/push.git`

remote = Git::Repo.open(Dir.current).remotes["origin"]
remote.fetch_url # => https://github.com/mosop/fetch.git
remote.push_url # => https://github.com/mosop/push.git
```

## Usage

```crystal
require "git"
```

and see:

* [Code Samples](#code_samples)

## Release Notes

See [Releases](https://github.com/mosop/git/releases).