Since I often use git for prose and textual writing, wordwise
diffs make a lot of sense to have quick access to. This commit
sets up a git-internal alias `git diffword` as well as an
even shorter `gdd` (diff) and `gdds` (diff staged) which
mimic the other diff aliases `gd`/`gds` already existing.
In addition to the existing `glg` and `glga` aliases for showing
one-line git logs for current or all branches, this commit adds
`glgd` and `glgad` for showing one-line git logs for current or
all branches *with date information*.
The date info comes from authoring date not committing date.
Added `git fetchall` (or `gfa`) alias which allows fetching the current
branch from all connected remotes simultaneously. May have some
unintended side effects when branches diverge, this is untested.
Using the `gcd` alias to checkout the development branch switches to, if
no `development` branch is found, the `staging` branch of a repository
automatically instead.
For git versions that support it, the aliases will use the newer
`switch` instruction instead of `checkout` for its use cases.
Creating a new branch through `gcb` is for example done by
`git switch -c` instead of the older `git checkout -b`.
Additionally streamlined git version checking to be a little faster and
to unify its approach on posix sh, bash and zsh instead of utilizing
individual checking functions.
Fixed bash alias loading for additional modules by loading both general
sh aliases as well as individual bash aliases.
Moved git stash push/save aliasing to split between bash/zsh shell since
zsh can check for the correct version of git to invoke push command
(only part of git since 2.13) and bash simply falls back to save.
Fixed 'pushall' option xargs error.
Added dealing with 'main' branch instead of 'master' branch in checkout
and rebase aliases, so that when invoking the commands it will default
to a master branch and fall back to a main branch before complaining
that no corresponding branch exists.
Should (silently) fix git repositories which switched to main in the
last few months, and simultaneously allows me to switch this repository
to main branch (already done.)
Every so often, when doing rebases, you need quick access to the git
rebase command to do something like '--edit-todo' or similar.
Every time, I tried to do `grb` since I already use these quick
shortcuts for `grbm` rebasing onto master, and `grbi`, `grbc` to rebase
interactively or continue one in progress. The base version is thus a
natural extension of the more detailed implementations of rebasing.
`git pushall` (aliased to gpa) will push the current branch to each
connected remote of the repository.
So, if you have gitlab, github and keybase connected as remotes, it will
push to each one in return. As with the normal push command, you can
specify which branch to push ('master', 'develop', ..) after the
command, or use `--all` to push all branches at once.
Made git aliasing exit if no git executable is found (which should not
happen, but still) instead of putting all aliases into the conditional.
Added unified colors to git diffs.
Cleaned up formatting of the files.
Fixed git stash alias (gsta) not correctly detecting zsh shell for git
version guessing.
Set default options to automatically rebase on pull, automatically prune
on fetch, and automatically stash and squash on rebasing.
Also made git diff highlight moved code.