Most of this stuff can be done with aliases. git stage git config alias.stage '!f () { if (( $# > 0 )); then git add -- "$@"; else git add -u; fi }; f' git unstage git config alias.unstage 'reset --' git undo is too ill-defind to actually implement. Sounds like the author wants it to be `git reset --hard HEAD`, but it's far more dangerous doing that while termed `git undo` than it is while termed `git reset --hard HE…
You're thinking of implementation details, but prompting for and placing the info into ~/.gitconfig is what a newbie git user almost always wants. What's wrong with doing this?