added git_cred function which adds the credential helper to the git config

This commit is contained in:
Honney
2026-07-02 16:26:12 +02:00
parent e79533e2b3
commit 7d13a9a5a8
+18
View File
@@ -289,3 +289,21 @@ if test -e /usr/bin/dd
sudo dd if=$argv[1] of=$argv[2] bs=4M status=progress oflag=sync
end
end
################ GIT ##########################################################
function git_cred
if test -f .git/config
# Check if the credential helper is already in the file
if grep -q "git-honney333-work-cred" .git/config
echo "Credential helper is already configured in .git/config"
else
echo "Adding Password tool to git"
# Append the blocks with a clean newline separator
echo -e "\n[credential]\n helper = !"$HOME"/.bin/git-honney333-work-cred" >> .git/config
end
else
echo "no .git/config file"
echo "could not add the credentials helper"
end
end