Skip to content

Instantly share code, notes, and snippets.

@siteslave
Last active August 8, 2023 07:18
Show Gist options
  • Save siteslave/e3e974545c57347997fb7ee0e0cfd8ae to your computer and use it in GitHub Desktop.
Save siteslave/e3e974545c57347997fb7ee0e0cfd8ae to your computer and use it in GitHub Desktop.
ลบ commit history ทั้งหมดทิ้ง เพื่อเริ่มใหม่

Checkout

git checkout --orphan latest_branch

Add all the files

git add -A

Commit the changes

git commit -am "commit message"

Delete the branch

git branch -D main

Rename the current branch to main

git branch -m main

Finally, force update your repository

git push -f origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment