diff --git a/configs/alias_useful.fish b/configs/alias_useful.fish index 4385b50..72afce4 100755 --- a/configs/alias_useful.fish +++ b/configs/alias_useful.fish @@ -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 \ No newline at end of file