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 John­son’s script. Here’s

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


Comments Feed
  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, 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
    | * 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. Michael

    cool script. this com­mand is a bit bogus: git —no-pager log —max-count=1

    it should be git log –max-count=1

  5. 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