Skip to content

Commit 37f85a8

Browse files
....
1 parent f32e130 commit 37f85a8

2 files changed

Lines changed: 35 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

0 commit comments

Comments
 (0)