Skip to content

Commit

Permalink
feat: ✨ add unset alias
Browse files Browse the repository at this point in the history
  • Loading branch information
tomgrv committed Jun 23, 2024
1 parent 8871223 commit 1759ec2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions src/gitutils/_unset.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions src/gitutils/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -11,4 +11,4 @@
"ghcr.io/tomgrv/devcontainer-features/gitversion": "5.*"
},
"entrypoint": "git init-gitutils"
}
}

0 comments on commit 1759ec2

Please sign in to comment.