This commit is contained in:
Marc Beninca 2024-11-17 13:58:39 +01:00
parent f4b9f4780c
commit 1bafe4d385
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -158,79 +158,88 @@ git_cherry_pick_continue() {
gcpc() { git_cherry_pick_continue "${@}"; } gcpc() { git_cherry_pick_continue "${@}"; }
# configure the user email # configure the user email
gcue() { git_config_user_email() {
git \ git \
config \ config \
"user.email" \ "user.email" \
"${@}" "${@}"
} }
gcue() { git_config_user_email "${@}"; }
# configure the user name # configure the user name
gcun() { git_config_user_name() {
git \ git \
config \ config \
"user.name" \ "user.name" \
"${@}" "${@}"
} }
gcun() { git_config_user_name "${@}"; }
# differences from last or between commits # differences from last or between commits
gd() { git_diff() {
git \ git \
diff \ diff \
"${@}" "${@}"
} }
gd() { git_diff "${@}"; }
# display what is indexed in cache # display what is indexed in cache
gdc() { git_diff_cached() {
git \ git \
diff \ diff \
--cached \ --cached \
"${@}" "${@}"
} }
gdc() { git_diff_cached "${@}"; }
# indexed character-level differences # indexed character-level differences
gdcw() { git_diff_cached_word() {
git \ git \
diff \ diff \
--cached \ --cached \
--word-diff-regex "." \ --word-diff-regex "." \
"${@}" "${@}"
} }
gdcw() { git_diff_cached_word "${@}"; }
# differences via external tool # differences via external tool
gdt() { git_diff_tool() {
git \ git \
difftool \ difftool \
--dir-diff \ --dir-diff \
"${@}" "${@}"
} }
gdt() { git_diff_tool "${@}"; }
# character-level differences # character-level differences
gdw() { git_diff_word() {
git \ git \
diff \ diff \
--word-diff-regex "." \ --word-diff-regex "." \
"${@}" "${@}"
} }
gdw() { git_diff_word "${@}"; }
# fetch from the remote repository # fetch from the remote repository
gf() { git_fetch() {
git \ git \
fetch \ fetch \
--tags \ --tags \
--verbose \ --verbose \
"${@}" "${@}"
} }
gf() { git_fetch "${@}"; }
# fetch from remote repository and prune local orphan branches # fetch from remote repository and prune local orphan branches
gfp() { git_fetch_prune() {
gf \ gf \
--prune \ --prune \
"${@}" "${@}"
} }
gfp() { git_fetch_prune "${@}"; }
# garbage collect all orphan commits # garbage collect all orphan commits
ggc() { git_garbage_collect() {
git \ git \
reflog \ reflog \
expire \ expire \
@ -241,24 +250,27 @@ ggc() {
--aggressive \ --aggressive \
--prune="now" --prune="now"
} }
ggc() { git_garbage_collect "${@}"; }
# initialize a new repository # initialize a new repository
gi() { git_init() {
git \ git \
init \ init \
"${@}" "${@}"
} }
gi() { git_init "${@}"; }
# initialize a new bare repository # initialize a new bare repository
gib() { git_init_bare() {
git \ git \
init \ init \
--bare \ --bare \
"${@}" "${@}"
} }
gib() { git_init_bare "${@}"; }
# log history # log history
gl() { git_log() {
local format="\ local format="\
%C(auto)%h%d %C(auto)%h%d
S %C(red)%GS S %C(red)%GS
@ -275,45 +287,51 @@ C %C(blue)%ci
--graph \ --graph \
"${@}" "${@}"
} }
gl() { git_log "${@}"; }
# log all history # log all history
gla() { git_log_all() {
gl \ gl \
--all \ --all \
"${@}" "${@}"
} }
gla() { git_log_all "${@}"; }
# log all history with patches # log all history with patches
glap() { git_log_all_patch() {
gl \ gl \
--all \ --all \
--patch \ --patch \
"${@}" "${@}"
} }
glap() { git_log_all_patch "${@}"; }
# log history with patches # log history with patches
glp() { git_log_patch() {
gl \ gl \
--patch \ --patch \
"${@}" "${@}"
} }
glp() { git_log_patch "${@}"; }
# abort the current merge commit # abort the current merge commit
gma() { git_merge_abort() {
git \ git \
merge \ merge \
--abort \ --abort \
"${@}" "${@}"
} }
gma() { git_merge_abort "${@}"; }
# do a merge commit # do a merge commit
gmc() { git_merge_commit() {
git \ git \
merge \ merge \
--no-ff \ --no-ff \
--message \ --message \
"${@}" "${@}"
} }
gmc() { git_merge_commit "${@}"; }
# fast-forward to remote branch # fast-forward to remote branch
gmf() { gmf() {