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:
gitis the command to process arguments, how is it supposed to pass the execution to something else?git pull --rebaseand a conflict occurs, it says "fix yer crap and hitgit pull --continue, or--abort.". I want to create another option--tablewhich will not abort the procedure, but let me leave all this crap in an unfinished state and pick it up later. I could create a newgit tablecommand but I feel that it's part ofpull, not it's own standalone command.gitcommand behaviour not just simply "add a custom flag". For that you obviously need to downloadgitsources, patch it, compile and use.