Created
May 22, 2016 08:06
-
-
Save vasilakisfil/909bc24e00760b62d0dcc8d5d5416ab2 to your computer and use it in GitHub Desktop.
Hack github's contribution history
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
require 'git' | |
require 'fileutils' | |
require 'date' | |
begin | |
FileUtils.rm_rf('.git/') | |
File.delete('myfile.out') | |
rescue Errno::ENOENT | |
end | |
File.open('myfile.out', 'a') { |f| | |
f.puts "This files holds all the commits..." | |
} | |
g = Git.init | |
g.add(all: true) | |
g.commit_all('initialize repo..') | |
10.times do |iteration| | |
405.downto(0).each do |i| | |
File.open('myfile.out', 'a') { |f| | |
f.puts i | |
} | |
date = (Date.today - i) | |
date_time = DateTime.new(date.year, date.month, date.day, rand(0...24), rand(0...60), rand(0...60)).strftime("%a, %d %b %Y %H:%M:%S %z") | |
g.add(all: true) | |
system(%Q{GIT_COMMITTER_DATE="#{date_time}" git commit --date "#{date_time}" -am "Changes...#{date_time}"}) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment