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