Last active
January 2, 2016 09:09
-
-
Save welldan97/8281161 to your computer and use it in GitHub Desktop.
Clean up git repo
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
#!/bin/bash | |
main(){ | |
reset_branch | |
remove_all_branches_besides_current | |
remove_all_stashes | |
remove_all_uncheked_files | |
} | |
reset_branch(){ | |
git reset --hard | |
} | |
remove_all_branches_besides_current(){ | |
git branch -D $(git branch | grep -v \* | xargs) | |
} | |
remove_all_stashes(){ | |
git stash clear | |
} | |
remove_all_uncheked_files(){ | |
git clean -d -f | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment