Last active
November 14, 2018 16:15
-
-
Save ijasxyz/05b20b7bc40db6f83f4141134591a64a to your computer and use it in GitHub Desktop.
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
# famous alias 'nah' with confirmation | |
# created after loosing uncommitted work using 'nah' in a wrong work | |
# this will show the changed files in the directory before cleaning them. | |
function nah(){ | |
echo | |
git status | |
echo | |
echo -e "\e[1m\e[91mDo you wish to reset the repo?\e[39m" | |
echo | |
select yn in "Yes" "No" | |
case $yn in | |
"Yes") | |
echo | |
git clean -qdf | |
git reset --hard | |
echo | |
echo -e "\e[1m\e[32mDone !\e[39m" | |
echo | |
break | |
;; | |
"No") | |
echo | |
echo -e "\e[1m\e[93mAborted !\e[39m" | |
echo | |
break | |
;; | |
*) echo -e "\e[1m\e[91mInvalid option $REPLY\e[39m";; | |
esac | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment