Reputation: 466
I want to set a specific alias in .gitconfig
to a bash script like this:
[alias]
example = "~/git-scripts/example-script.sh"
instead of:
[alias]
example = "!f() { arg1=$1; echo $arg1; }; f"
So, the echo script above would be in this file ~/git-scripts/example-script.sh
When i'm trying to execute a alias like this, i got this error:
expansion of alias 'example' failed; ~/git-scripts/example-script.sh is not a git command
What's wrong?
Upvotes: 1
Views: 802
Reputation: 466
As Charles Duffy said in the comments area, i could make it work like this:
[alias]
example = "! ~/git-scripts/example-script"
Just add !
before the script path
Be careful with:
$ chmod +x YOUR_SCRIPT_PATH
.sh
) at the script file. You can read more about this hereUpvotes: 1