.gitconfig : [alias] searchlog = "!f() { git log --all --decorate --graph -i --grep \"$1\"; }; f"
Note the positonal parameter $1 here, we escape the quote also. The function inside the alias is a shell function.
To use this alias command, type for example: git searchlog testThis will search the Git log for the parameter passed in (test) and include some flags to decorate the log displayed. Using Git aliases, we can do lenghty Git commands with shorter aliased commands.
No comments:
Post a Comment