Skip to content

crystal-git/git

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: crystal-git/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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •