Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

how to remove all commits in git

git checkout --orphan latest_branch
git add -A
git commit -am "commit message"
git branch -D main
git branch -m main
git push -f origin main
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #commits #git
ADD COMMENT
Topic
Name
4+8 =