Skip to content

Commit

Permalink
add gitinfo script
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel tonini committed Feb 22, 2010
1 parent 1ee8f9c commit c8ab59a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions gitinfo.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env ruby

# This script is based on the git-info shell script from Duane Johnson.
# I like the ruby flavour, so i rebuild it in ruby. :)

until File.directory? ".git" do
Dir.chdir ".." if Dir.pwd != "/"
end

abort "Not a git repository (or any of the parent directories): .git" unless File.directory? ".git"

puts "== Remote URL: #{`git remote -v`}"
puts "== Remote Branches:"
puts `git branch -r --color`
puts "== Local Branches:"
puts `git branch --color`
puts "== Configuration (.git/config)"
puts `cat .git/config`
puts "== Most Recent Commit"
puts `git log -1 --color`

0 comments on commit c8ab59a

Please sign in to comment.