From 88d1ea0774fbb5bde0955da1490f606c3c999e97 Mon Sep 17 00:00:00 2001 From: pgrondek Date: Tue, 16 Jun 2020 02:56:05 +0200 Subject: [PATCH] Add git config --- .config/git/config | 10 ++++++++++ bin/git-purge | 9 +++++++++ 2 files changed, 19 insertions(+) create mode 100644 .config/git/config create mode 100755 bin/git-purge diff --git a/.config/git/config b/.config/git/config new file mode 100644 index 0000000..5feefad --- /dev/null +++ b/.config/git/config @@ -0,0 +1,10 @@ +[user] + name = Przemysław Grondek +[alias] + unadd = reset +[help] + autocorrect = 1 +[remotes] + prune = true +[pull] + rebase = true diff --git a/bin/git-purge b/bin/git-purge new file mode 100755 index 0000000..6ebacbe --- /dev/null +++ b/bin/git-purge @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +BRANCHES=$(git branch --merged|egrep -v "(^\*|master|dev)") + +if [ -z "${BRANCHES}" ] ; then + echo "Nothing to delete" +else + git branch -d ${BRANCHES} +fi