Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6933055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:46:59+00:00 2026-05-27T11:46:59+00:00

How can you automatically import the latest github commit number from github? The goal

  • 0

How can you automatically import the latest github commit number from github?

The goal would be to have that number visible on your webpage footer like SO does with date.

Whats the structure:

I have a production branch which is deployed using Capistrano. I want to show the latest github commit number, with the date when it was deployed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:46:59+00:00Added an answer on May 27, 2026 at 11:46 am

    Assuming you use gem settingslogic for app settings, put this in your initializers:

    git_log = `git log -1 --pretty="format:%H %ci"`
    if git_log =~ /^([\d\w]+?)\s(.+)$/
      Settings[:git_revision] = $1
      Settings[:git_update]   = $2.strip
    end
    

    You will have last git commit SHA in Settings.git_revision and commit date in Settings.git_update.

    Additionally you can get last tag:

    git_tag = `git describe --tags --abbrev=0`
    Settings[:git_tag] = git_tag.strip if git_tag
    

    It will be available in Settings.git_tag.

    Update:

    I released a small ruby gem git-revision. With it you can simply do:

    "commit: #{Git::Revision.commit} date: #{Git::Revision.date}"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can you automatically import the latest build/revision number in subversion? The goal would
I have a custom model fields, that can have 'chain' argument. from django.db import
In python 2.7, by using from __future__ import division, print_function I can now have
Is there a tool out there that can automatically convert Python to Java? Can
Is there some tool that can automatically convert the following c style code A
Is there an ISAPI filter that can automatically add the Last-Modified header in IIS?
We have a deployment system at my office where we can automatically deploy a
The most favorite feature of StackOverflow for me is that it can automatically detect
I have 400,000 MIDIs that I need to automatically convert to MP3s. I know
I have a form (forms.Form) that automatically generates the choices for its own choicefield

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.