I would like to add my own flag to an existing git command. Is this doable?
Something like git diff --myownthing
.
How would I do this?
I would like to add my own flag to an existing git command. Is this doable?
Something like git diff --myownthing
.
How would I do this?
In your .gitconfig file you can define bash functions as aliases. I'm not sure if you could get the functionality you want but you could make git pull perform some other steps as well as /instead of the default.
For instance I have diff = "!f() { git diff --color=always "$@" | less -R; }; f"
as an alias which pipes git diff to less rather than stdout.
I'm not sure if you can modify the built-in Git commands to accept additional parameters without actually modifying Git source code, but you can easily make Git aliases that will accept parameters.
See, for example: