1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| import datetime import os import random import time
def get_time(start_t, end_t): a1=(start_t,1,1,0,0,0,0,0,0) a2=(end_t,12,31,23,59,59,0,0,0) start=time.mktime(a1) end=time.mktime(a2)
t=random.randint(start,end) date_touple=time.localtime(t) date=time.strftime("%Y-%m-%d %H:%M:%S",date_touple) time_array = time.strptime(date, "%Y-%m-%d %H:%M:%S") timestamp = int(time.mktime(time_array))
return timestamp
for i in range(1, 600): filename = r"test" + str(i) + ".txt" file = open(filename, 'w') file.write("a test") file.close() command_add = "git add " + filename print(command_add) result = os.system(command_add)
time_stamp = str(get_time(2014, 2019))
command_commit = "git commit --date=" + time_stamp + " -m " + '"this is a commit"' print(command_add," ",command_commit) result = os.system(command_commit)
result = os.system('git config --global http.sslVerify "false"') time.sleep(1) result = os.system("git push -u origin master")
|