Skip to content

Instantly share code, notes, and snippets.

View lzkill's full-sized avatar

Luiz Kill lzkill

  • Vitória/Brasil
View GitHub Profile
@lzkill
lzkill / gclear.sh
Last active January 19, 2023 11:25
Clear git history
#!/bin/bash
default_branch=`basename $(git symbolic-ref --short refs/remotes/origin/HEAD)`
git checkout --orphan tmp
git add -A
git commit -m "first commit"
git branch -D $default_branch
git branch -m $default_branch
git push -f --set-upstream origin $default_branch