Skip to content

Instantly share code, notes, and snippets.

@fakerybakery
Created June 20, 2023 22:30
Show Gist options
  • Save fakerybakery/5da93737c1e44c563771335ab7cacbec to your computer and use it in GitHub Desktop.
Save fakerybakery/5da93737c1e44c563771335ab7cacbec to your computer and use it in GitHub Desktop.
Make a git repo with 10M commits

Make a git repo with 10M commits

Just run sh run.sh

License: Please credit this if you publish a repo made with this

import subprocess
from tqdm import tqdm
subprocess.run(['git', 'init'], stdout=subprocess.DEVNULL)
subprocess.run(['touch', 'git.txt'], stdout=subprocess.DEVNULL)
for i in tqdm(range(1, 10000001)):
with open('git.txt', 'w') as file:
file.write(str(i))
subprocess.run(['git', 'add', 'git.txt'], stdout=subprocess.DEVNULL)
subprocess.run(['git', 'commit', '-m', f'Commit {i}'], stdout=subprocess.DEVNULL)
print("Git repository created with 10 million commits.")
mkdir git
cd git
python3 ../run.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment