git

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

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.

Repository

git

Owner
Statistic
  • 2
  • 0
  • 0
  • 0
  • 3
  • about 7 years ago
  • October 22, 2017
License

MIT License

Links
Synced at

Fri, 22 Nov 2024 04:10:15 GMT

Languages