Git Info — Almost Like “svn info”

I have been try­ing to find some­thing like svn info but for Git. Luck­i­ly, I stum­bled upon Duane Johnson’s script. Here’s git-info.sh:

I made an alias in my .pro­file to make it a bit more acces­si­ble:

18 Comments

Comments Feed · Trackback Address
  1. LeoB

    Thanks for that.

    was hop­ing git would have some­thing bet­ter than “cat .git/config” but no 😀

    Nice lit­tle script any­way

  2. Michael Fairchild

    the git log line did not work with my ver­sion, 1.7.6.1. I replaced it with

    git –no-pager log –pretty=format:’%h was %an, %ar: %s’ –graph -n 10

    which now gives nice com­pact out­put of the last 10 com­mits, such as

    * 0f4acd3 was Michael, 2 months ago: Merge branch ‘mas­ter’ of http://github.com/mxcl/homebrew
    |\
    | * b769471 was Adam Van­den­berg, 2 months ago: uws­gi: remove ver­bose warn­ing
    | * 0228551 was Peter Hol­lows, 4 months ago: polipo: launchd plist
    | * 6d32041 was Jonas Bengts­son, 4 months ago: elinks: enable 256 col­ors

  3. qa

    Hi what if i want all these in my application..i want to dis­play the same[git last commit,git url etc] in my “About my project page” which i have done in rails

  4. Antonio Hdez. Blas

    Hi, you can drop git-info (as exe­cutable) at your ‘git-core’ direc­to­ry and then you can just exe­cute ‘git info’ inside your repos­i­to­ry, no need for the alias in your shell. This also means that ‘git info’ would be avail­able for all the users in your sys­tem.

    In Slack­ware ‘git-core’ direc­to­ry is /us­r/libex­ec/git-core/.

    - Cheers

Leave a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>