Skip to content

Commit d26c547

Browse files
Add files via upload
1 parent b853faa commit d26c547

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

‎clear-commits.bat‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@echo off
2+
REM Switch to a new orphan branch
3+
git checkout --orphan new_branch
4+
5+
REM Stage all changes
6+
git add .
7+
8+
REM Commit changes
9+
git commit -m "new_commit"
10+
11+
REM Delete the old main branch
12+
git branch -D main
13+
14+
REM Rename the new branch to main
15+
git branch -m main
16+
17+
REM Force push to the remote main branch
18+
git push -f origin main

‎clear-commits.ps1‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Switch to a new orphan branch
2+
git checkout --orphan new_branch
3+
4+
# Stage all changes
5+
git add .
6+
7+
# Commit changes
8+
git commit -m "new_commit"
9+
10+
# Delete the old main branch
11+
git branch -D main
12+
13+
# Rename the new branch to main
14+
git branch -m main
15+
16+
# Force push to the remote main branch
17+
git push -f origin main

‎clear-commits.sh‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Switch to a new orphan branch
4+
git checkout --orphan new_branch
5+
6+
# Stage all changes
7+
git add .
8+
9+
# Commit changes
10+
git commit -m "new_commit"
11+
12+
# Delete the old main branch
13+
git branch -D main
14+
15+
# Rename the new branch to main
16+
git branch -m main
17+
18+
# Force push to the remote main branch
19+
git push -f origin main

0 commit comments

Comments
 (0)