diff --git a/src/gitutils/_unset.sh b/src/gitutils/_unset.sh new file mode 100644 index 0000000..d5e2066 --- /dev/null +++ b/src/gitutils/_unset.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +#### Goto repository root +cd "$(git rev-parse --show-toplevel)" >/dev/null + +echo git config ${2:---local} --get-regexp "^${1:-[a-z]+}\\." + +#### Unset all git config keys starting with the given prefix +git config ${2:---local} --get-regexp "^${1:-[a-z]+}\\." | cut -d ' ' -f 1 | while read alias_key; do + git config ${2:---local} --unset-all "$alias_key"; +done diff --git a/src/gitutils/devcontainer-feature.json b/src/gitutils/devcontainer-feature.json index ec889e6..d1f655a 100644 --- a/src/gitutils/devcontainer-feature.json +++ b/src/gitutils/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "Git Aliases", "id": "gitutils", - "version": "1.2.1", + "version": "1.3.0", "description": "A feature to add useful Git aliases to your shell.", "installsAfter": [ "ghcr.io/devcontainers/features/common-utils", @@ -11,4 +11,4 @@ "ghcr.io/tomgrv/devcontainer-features/gitversion": "5.*" }, "entrypoint": "git init-gitutils" -} +} \ No newline at end of file