Skip to content

Commit c72d11e

Browse files
authored
Create create-repo.py
1 parent 944c023 commit c72d11e

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

create-repo.py

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import os
2+
import subprocess
3+
import requests
4+
import base64
5+
6+
# GitHub repo details
7+
REPO_NAME = "contribution-graph"
8+
README_CONTENT = "Made with https://github.com/0vm/commit-graph-spoof" # Keep this if you want to give me credit :D
9+
10+
# Get user GitHub credentials
11+
GITHUB_USER = input("Enter your GitHub username: ").strip()
12+
GITHUB_TOKEN = input("Enter your GitHub personal access token: ").strip()
13+
14+
# Step 1: Create the repo on GitHub
15+
print("Creating GitHub repository...")
16+
17+
repo_data = {
18+
"name": REPO_NAME,
19+
"private": False, # Change to True if you want a private repo
20+
"description": "Commit Graph :D https://github.com/0vm/commit-graph-spoof",
21+
}
22+
23+
response = requests.post(
24+
"https://api.github.com/user/repos",
25+
json=repo_data,
26+
headers={"Authorization": f"token {GITHUB_TOKEN}"}
27+
)
28+
29+
if response.status_code == 201:
30+
print(f"✅ Repository '{REPO_NAME}' created!")
31+
else:
32+
print(f"❌ Failed to create repository: {response.json().get('message')}")
33+
exit(1)
34+
35+
# Step 2: Clone the new repo
36+
GIT_REPO_URL = f"https://{GITHUB_USER}:{GITHUB_TOKEN}@github.com/{GITHUB_USER}/{REPO_NAME}.git"
37+
subprocess.run(["git", "clone", GIT_REPO_URL])
38+
os.chdir(REPO_NAME)
39+
40+
# Step 3: Create README.md
41+
with open("README.md", "w") as f:
42+
f.write(README_CONTENT)
43+
44+
# Step 4: Commit the README with a fake timestamp
45+
subprocess.run(["git", "add", "README.md"])
46+
subprocess.run(["git", "commit", "-m", "GitHub @0vm", "--date=1970-01-01T00:00:00"])
47+
48+
# Step 5: Push the commit
49+
subprocess.run(["git", "branch", "-M", "main"])
50+
subprocess.run(["git", "push", "-u", "origin", "main"])
51+
52+
print(f"Repo '{REPO_NAME}' pushed!")
53+
print(f"View it here: https://github.com/{GITHUB_USER}/{REPO_NAME}")

0 commit comments

Comments
 (0)