This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
git checkout yourBranch | |
git reset $(git merge-base master $(git branch --show-current)) | |
git add -A | |
git commit -m "one commit on yourBranch" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this should get everything down to a single commit | |
# | |
git checkout --orphan tmp-main | |
git commit -m "initial commit" | |
# move the local branch | |
git branch -f main | |
git checkout main | |
# delete the temp branch | |
git branch -d tmp-main | |
# git push --force |