I am looking for code examples for rugged or grit , showing how to do git push .
Background
I have rake deploy:staging and deploy:production tasks that I use to deploy my application.
I am deploying to heroku, so these tasks essentially do the following:
- Get the last tag (e.g.
git describe --abbrev=0 ) - Click the version represented by this tag on the specified remote (for example,
git push staging v1.00 ) - Save the version in the heroku var configurator (for example,
heroku config:add APP_VERSION=v1.00 )
(There are also some checks there to make sure I remember to create a new tag before clicking, etc.)
Initially, I used the system calls from my Rakefile for these CLI commands; then I switched to using git and the api hero .
However, the git stone seems abandoned (no commitment for the last year); It seems that Grit and Durable are now the standard gems for working with Git.
Unfortunately, given the lack of documentation, I cannot figure out how to do git push with any of these libraries.
(In the following examples, suppose the remote / branch that I click on is the source / master and is already configured as remote in the local repo)
Since lasting:
$ irb 2.0.0-p0 :001 > require 'rugged' => true 2.0.0-p0 :002 > repo = Rugged::Repository.new('/path/to/repo') =>
Now for grit:
$ irb 2.0.0-p0 :001 > require 'grit' => true 2.0.0-p0 :002 > repo = Grit::Repo.new('/path/to/repo') =>
Any help would be greatly appreciated.
Scott
source share