Skip to content

Latest commit

History

History
51 lines (39 loc) · 1.71 KB

File metadata and controls

51 lines (39 loc) · 1.71 KB

commit-graph-hack

Simple Ruby and bash script that will enhance your commit history in your GitHub profile commit graph.

How does it work?

The following Ruby code will generates a bash script that then will create random numbers of commits each day for the period. It's a bit hacky but... it works!

require'active_support/time'classCommitGraphHack# the period for which the data should be created (as time ago from now)period=12.monthstart=Time.now - periodlength=period / 86400commits=length.times.map{Random.rand(10)}randomness={0=>0,1=>0,2=>0,3=>1,4=>2,5=>3,6=>6,7=>0,8=>0,9=>1,10=>0}File.open('./generate-commits.sh','w')do |f|
commits.eachdo |commit|
randomness[commit].timesdof.puts"echo \"#{Random.new_seed}\" > ./temp"f.puts"git add ./temp"f.puts"GIT_AUTHOR_DATE='#{start.to_s[0..9]}T12:00:00' GIT_COMMITTER_DATE='#{start.to_s[0..9]}T12:00:00' \\"f.puts"git commit -a -m 'Make the commit graph burn :fire:' --date='#{start.to_s[0..9]}T12:00:00'"endstart += 86400endf.puts"rm ./temp"f.puts"git rm ./temp"f.puts"git commit -a -m 'Made some rocket science :rocket:'"endend

To apply it to any repository you like, simply copy the generated bash script into your repository, run it and remove the temp file afterwards.

Heavily inspired by

License

Licensed under MIT License