git~crystal-git

Manipulate Git repositories in an object-oriented way
0.5.3 Latest release released
crystal-git/libgit2
15 2 2
crystal-git

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

Installation

Add this to your application's shard.yml:

dependencies:
  git:
    github: mosop/git

Code Samples

Checkout from Remote Branches

`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

`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

require "git"

and see:

Release Notes

See Releases.

git:
  github: crystal-git/libgit2
  version: ~> 0.5.3
License MIT
Crystal 0.21.1

Authors

  • mosop

Dependencies 1

  • safec 0.2.1
    {'github' => 'mosop/safec', 'version' => '0.2.1'}

Development Dependencies 2

  • crystal_plus 0.1.2
    {'github' => 'mosop/crystal_plus', 'version' => '0.1.2'}
  • stdio 0.1.3
    {'github' => 'mosop/stdio', 'version' => '0.1.3'}

Dependents 0

Last synced .
search fire star recently