Thursday, November 24, 2022

How to delete all commit history in GitHub & repush to main?

Create a new Branch:

git checkout --orphan latest_branch

Add your all the files:

git add .

Save the changes with commit:

git commit -m "commit message"

Delete Main Branch:

git branch -D main

Rename latest_branch to main:

git branch -m main

Force update the repo:

git push -f origin main

No comments:

Post a Comment

How to select all blank cells in a range to keep unlocked in excel.

  Select Only the Blank Cells: Press Ctrl + G (or F5 ) to open the Go To dialog box. Click the Special... button at the bottom left. Sele...