File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments