From 19bdae37a68a8ef61aa3211fb32f05b1bada2fd8 Mon Sep 17 00:00:00 2001 From: ivan katliarchuk Date: Tue, 22 Sep 2020 20:38:17 +0100 Subject: [PATCH] add git remote remove --- README.md | 8 ++++++-- shell/functions | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 533b8a8..1d56485 100644 --- a/README.md +++ b/README.md @@ -159,11 +159,15 @@ These scripts are meant to run only on OS X - [ ] Dotbot templater plugin - [ ] Dotbot import private repos plugin +## QA + +> How to switch project specific versions and golang verions + ## Awailable Commands ``` -$ make help +$ make help Usage: make [target] [VARIABLE=value] Targets: install-local Install locally @@ -175,7 +179,7 @@ vm-dowm Run on Mac. Down ignore-dirty Ignore dirty commits install-deps Install dependencies git-submodule Git submodules update -git-module-remove Remove submodule MODULE=something +git-module-remove Remove submodule MODULE=something ``` diff --git a/shell/functions b/shell/functions index 1e2c023..aa24c02 100755 --- a/shell/functions +++ b/shell/functions @@ -308,6 +308,25 @@ versions() { echo "macOS: $(archey -c)" } +# Remove remote branches +gitrmb() { + branch="" + pattern="" + while :; do + case $1 in + -b|--branch) branch="$2"; shift ;; + -p|--pattern) pattern="$2"; shift ;; + *) echo "Usage: $0 [-b ] [-p ]" 1>&2; break ;; + esac + shift + done + if [ -n "$branch" ] && [ -n "$pattern" ]; then + git branch -r --format "%(refname:short)" --merged "origin/${branch}" | cut -d/ -f2- | grep "${pattern}" | xargs -n 1 git push --delete origin + else + echo "No branches removed." + fi +} + # Provide information about currect user iam() { echo -e "$(whoami) < whoami" @@ -371,3 +390,7 @@ tunnel() { local port="${4}" ssh -nfNJ "${user}@${bastionip}" "${user}@${privatip}" "-L127.0.0.1:${port}:127.0.0.1:${port}" } + +big-folders() { + du -k * | awk '$1 > 500000' | sort -nr +}