Created
September 9, 2014 23:49
-
-
Save JamesHagerman/f61456eec50f57acd03f to your computer and use it in GitHub Desktop.
This simple Ruby script will find all of the git repo's on your machine and dump all of the git history for you. Exclusions are on line 5. Your Git username is on line 13.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'shellwords' | |
puts "Finding all git repos on this machine..." | |
all_paths = `find ~/ -iname ".git" -not -path "*.rvm*" -not -path "*Circuits*" -not -path "*CLOUDS*" -not -path "*disorient*"`.split("\n") | |
# puts "Paths: #{all_paths}" | |
# Actually grab the history of each repo and dump it to the command line: | |
all_paths.each_with_index do |path,i| | |
Dir.chdir(path) do | |
fixed_path = Shellwords.escape(path) | |
puts "History of repo at: #{fixed_path}" | |
cmd = "git --no-pager log --pretty=format:\"%ad:%an:%d:%B\" --date=local --all --committer=\"James Hagerman\"" | |
system(cmd) | |
end | |
puts "==============" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment