Use case

  • A repository that hosts a static website.

Steps

Creating a new branch

1
git checkout --orphan latest_branch

Adding files to the new branch

1
2
git add -A
git commit -am "update"

Deleting the old branch

1
git branch -D main

Renaming the new branch

1
git branch -m main

Force push to the remote repository

1
git push -f origin master

References