Get current git commit information in Rails
Add this line to your application's Gemfile:
gem 'current_commit_rails'
And then execute:
$ bundle
Include current_commit_rails
in your Gemfile
(As shown above)
Get current GIT commit info via
CurrentCommitRails.commit_hash
Example:
CurrentCommitRails.commit_hash.sha #=> '38b96a38ec61b22cf9d385b8926cf63f4fdf3dcc'
Attributes including:
[:sha, :time, :branch, :author, :author_email, :author_time, :committer, :committer_email, :comitter_time]
- Fork it ( https://github.com/gzzengwei/current_commit_rails/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request