Created
March 13, 2025 09:17
-
-
Save ywwwtseng/2c235aa4d1073601eea3a99f322b0d95 to your computer and use it in GitHub Desktop.
sh-func.sh
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
del_all_branch () { | |
current_branch=$(git branch --show-current) | |
git branch | grep -Ev "^\s*(master|main|develop|dev|${current_branch})$" | xargs git branch -D | |
} | |
kill_port() { | |
if [ -z "$1" ]; then | |
echo "Usage: kill_port <port>" | |
return 1 | |
fi | |
lsof -t -i tcp:$1 | xargs kill -9 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment