Fetch Current Branch and Latest Commit_ID in Rails Application
Sometimes while running project on a staging server, we can are required to check the current branch and latest commit for the code. Simply create a new Initializer file git_info.rb
1 2 |
|
and now you can use these GIT_BRANCH
and GIT_COMMIT
anywhere in your views and as per requirement.