Skip to content

Commit 02de53d

Browse files
Add files via upload
1 parent 007d3f7 commit 02de53d

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Cursed Entertainment
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

clear-commits.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import subprocess
2+
3+
def run_command(command):
4+
"""Run a command in the shell and print the output."""
5+
try:
6+
result = subprocess.run(command, check=True, text=True, capture_output=True)
7+
print(result.stdout)
8+
except subprocess.CalledProcessError as e:
9+
print(f"Error: {e.stderr}")
10+
exit(1)
11+
12+
# Switch to a new orphan branch
13+
run_command(["git", "checkout", "--orphan", "new_branch"])
14+
15+
# Stage all changes
16+
run_command(["git", "add", "."])
17+
18+
# Commit changes
19+
run_command(["git", "commit", "-m", "new_commit"])
20+
21+
# Delete the old main branch
22+
run_command(["git", "branch", "-D", "main"])
23+
24+
# Rename the new branch to main
25+
run_command(["git", "branch", "-m", "main"])
26+
27+
# Force push to the remote main branch
28+
run_command(["git", "push", "-f", "origin", "main"])

0 commit comments

Comments
 (0)