By using this site, you agree to have cookies stored on your device, strictly for functional purposes, such as storing your session and preferences.

Dismiss

 pusher.py

View raw Download
text/x-script.python • 368 B
Python script, ASCII text executable
        
            
1
#!/usr/bin/python3
2
3
import subprocess
4
5
commits = list(reversed(subprocess.check_output(["git", "log", "--format=%H",]).decode().split()))
6
7
for i, commit in enumerate(commits):
8
print(f"pushing {commit}")
9
print("-" * 48)
10
subprocess.run(["git", "push", "origin", f"{commit}:refs/heads/main"])
11
input(f"pushed {i+1}/{len(commits)} commits; push another?")
12
13