Add configuration for git
- Add .config/git/config + Define aliases + Configure default behavior in various situations + Add user information with signing key - Add .config/git/commit_msg_template.txt - Add .config/git/ignore - Integrate `git` aliases into the shell
This commit is contained in:
parent
3017a7bdec
commit
721c2fd905
21 changed files with 1122 additions and 66 deletions
|
|
@ -3,9 +3,6 @@
|
|||
# Aliases used in all kinds of shells
|
||||
|
||||
|
||||
# Manage the bare `git` repository in ~/ holding the dotfiles
|
||||
alias dotfiles='git --git-dir=$DOTFILES_DIR --work-tree=$HOME'
|
||||
|
||||
|
||||
|
||||
forget() { # the current history and restore $HISTFILE from disk
|
||||
|
|
@ -72,3 +69,31 @@ alias la='ls --classify --format=vertical --almost-all'
|
|||
alias lal='ls --classify --format=long --almost-all'
|
||||
alias ll='ls --classify --format=long'
|
||||
alias lla='lal'
|
||||
|
||||
|
||||
|
||||
if _command_exists git; then
|
||||
|
||||
# Manage the bare `git` repository in ~/ holding the dotfiles
|
||||
alias dotfiles='git --git-dir=$DOTFILES_DIR --work-tree=$HOME'
|
||||
|
||||
alias g='git'
|
||||
|
||||
# Create "g" prefixed aliases from the "real" aliases
|
||||
# defined under "[alias]" in ~/.config/git/config,
|
||||
# for example, `gap` for `git add --patch`
|
||||
#
|
||||
# Interactive shells only: This spawns a `git` process,
|
||||
# which every non-interactive `bash` via `$BASH_ENV`
|
||||
# (e.g., ":!cmd" in `vi`) would pay on each command
|
||||
# => There, `g ap` works just as well as `gap`
|
||||
case $- in
|
||||
*i*)
|
||||
for al in $(git aliases --real); do
|
||||
eval "alias g$al='git $al'"
|
||||
done
|
||||
unset al
|
||||
;;
|
||||
esac
|
||||
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue