diff --git a/clear-commits.ps1 b/clear-commits.ps1 new file mode 100644 index 0000000..db7f511 --- /dev/null +++ b/clear-commits.ps1 @@ -0,0 +1,17 @@ +# Switch to a new orphan branch +git checkout --orphan new_branch + +# Stage all changes +git add . + +# Commit changes +git commit -m "new_commit" + +# Delete the old main branch +git branch -D main + +# Rename the new branch to main +git branch -m main + +# Force push to the remote main branch +git push -f origin main \ No newline at end of file diff --git a/clear-commits.sh b/clear-commits.sh new file mode 100644 index 0000000..2c62b8f --- /dev/null +++ b/clear-commits.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Switch to a new orphan branch +git checkout --orphan new_branch + +# Stage all changes +git add . + +# Commit changes +git commit -m "new_commit" + +# Delete the old main branch +git branch -D main + +# Rename the new branch to main +git branch -m main + +# Force push to the remote main branch +git push -f origin main \ No newline at end of file