From 11a4b0cdc7af5a6022ca496f0b5ba9d7234d9351 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 27 Jul 2025 13:29:07 +0200 Subject: [PATCH] git --- sh/alias/git.sh | 136 ++++++++++++++++++++++++------------------------ 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/sh/alias/git.sh b/sh/alias/git.sh index 7e6799c..31605b3 100644 --- a/sh/alias/git.sh +++ b/sh/alias/git.sh @@ -13,7 +13,7 @@ RWX_GIT_LOG_FORMAT_SHORT="%C(auto)%h %C(green)%ad %C(auto)%s %d" # add to index #= ga -a__git_add() { +rwx_git_add() { git \ add \ "${@}" @@ -21,7 +21,7 @@ a__git_add() { # add all to index #= gaa -a__git_add_all() { +rwx_git_add_all() { git \ add \ --all \ @@ -30,7 +30,7 @@ a__git_add_all() { # add parts of all to index #= gaap -a__git_add_all_patch() { +rwx_git_add_all_patch() { git \ add \ --all \ @@ -40,7 +40,7 @@ a__git_add_all_patch() { # add parts to index #= gap -a__git_add_patch() { +rwx_git_add_patch() { git \ add \ --patch \ @@ -49,7 +49,7 @@ a__git_add_patch() { # create a branch #= gb -a__git_branch() { +rwx_git_branch() { git \ branch \ "${@}" @@ -57,7 +57,7 @@ a__git_branch() { # delete a branch #= gbd -a__git_branch_delete() { +rwx_git_branch_delete() { git \ branch \ --delete \ @@ -66,7 +66,7 @@ a__git_branch_delete() { # force a branch deletion #= gbdf -a__git_branch_delete_force() { +rwx_git_branch_delete_force() { git \ branch \ --delete \ @@ -76,7 +76,7 @@ a__git_branch_delete_force() { # list branches #= gbl -a__git_branch_list() { +rwx_git_branch_list() { git \ branch \ --all \ @@ -88,7 +88,7 @@ a__git_branch_list() { # set the link to a remote branch from a local branch #= gbsu -a__git_branch_set_upstream() { +rwx_git_branch_set_upstream() { git \ branch \ --set-upstream-to \ @@ -97,7 +97,7 @@ a__git_branch_set_upstream() { # switch to a branch or checkout file(s) from a commit #= gc -a__git_checkout() { +rwx_git_checkout() { git \ checkout \ "${@}" @@ -105,7 +105,7 @@ a__git_checkout() { # checkout an orphan branch #= gco -a__git_checkout_orphan() { +rwx_git_checkout_orphan() { git \ checkout \ --orphan \ @@ -114,7 +114,7 @@ a__git_checkout_orphan() { # pick a commit #= gcp -a__git_cherry_pick() { +rwx_git_cherry_pick() { git \ cherry-pick \ "${@}" @@ -122,7 +122,7 @@ a__git_cherry_pick() { # abort the commit pick #= gcpa -a__git_cherry_pick_abort() { +rwx_git_cherry_pick_abort() { git \ cherry-pick \ --abort \ @@ -131,7 +131,7 @@ a__git_cherry_pick_abort() { # continue the commit pick #= gcpc -a__git_cherry_pick_continue() { +rwx_git_cherry_pick_continue() { git \ cherry-pick \ --continue \ @@ -140,7 +140,7 @@ a__git_cherry_pick_continue() { # clean untracked files #= gcf -a__git_clean_force() { +rwx_git_clean_force() { git \ clean \ -d \ @@ -150,7 +150,7 @@ a__git_clean_force() { # redo the last commit with a different message #= gcam -a__git_commit_amend_message() { +rwx_git_commit_amend_message() { git \ commit \ --amend \ @@ -160,7 +160,7 @@ a__git_commit_amend_message() { # make a root commit #= gcem -a__git_commit_empty_message() { +rwx_git_commit_empty_message() { git \ commit \ --allow-empty \ @@ -171,7 +171,7 @@ a__git_commit_empty_message() { # commit the index #= gcm -a__git_commit_message() { +rwx_git_commit_message() { git \ commit \ --message \ @@ -180,7 +180,7 @@ a__git_commit_message() { # configure the user email #= gcue -a__git_config_user_email() { +rwx_git_config_user_email() { git \ config \ "user.email" \ @@ -189,7 +189,7 @@ a__git_config_user_email() { # configure the user name #= gcun -a__git_config_user_name() { +rwx_git_config_user_name() { git \ config \ "user.name" \ @@ -198,7 +198,7 @@ a__git_config_user_name() { # differences from last or between commits #= gd -a__git_diff() { +rwx_git_diff() { git \ diff \ "${@}" @@ -206,7 +206,7 @@ a__git_diff() { # display what is indexed in cache #= gdc -a__git_diff_cached() { +rwx_git_diff_cached() { git \ diff \ --cached \ @@ -215,7 +215,7 @@ a__git_diff_cached() { # indexed character-level differences #= gdcw -a__git_diff_cached_word() { +rwx_git_diff_cached_word() { git \ diff \ --cached \ @@ -225,7 +225,7 @@ a__git_diff_cached_word() { # differences via external tool #= gdt -a__git_diff_tool() { +rwx_git_diff_tool() { git \ difftool \ --dir-diff \ @@ -234,7 +234,7 @@ a__git_diff_tool() { # character-level differences #= gdw -a__git_diff_word() { +rwx_git_diff_word() { git \ diff \ --word-diff-regex "." \ @@ -243,7 +243,7 @@ a__git_diff_word() { # fetch from the remote repository #= gf -a__git_fetch() { +rwx_git_fetch() { rwx_gpg_agent_update && git \ fetch \ @@ -254,15 +254,15 @@ a__git_fetch() { # fetch from remote repository and prune local orphan branches #= gfp -a__git_fetch_prune() { - a__git_fetch \ +rwx_git_fetch_prune() { + rwx_git_fetch \ --prune \ "${@}" } # garbage collect all orphan commits #= ggc -a__git_garbage_collect() { +rwx_git_garbage_collect() { git \ reflog \ expire \ @@ -276,7 +276,7 @@ a__git_garbage_collect() { # initialize a new repository #= gi -a__git_init() { +rwx_git_init() { git \ init \ "${@}" @@ -284,7 +284,7 @@ a__git_init() { # initialize a new bare repository #= gib -a__git_init_bare() { +rwx_git_init_bare() { git \ init \ --bare \ @@ -293,7 +293,7 @@ a__git_init_bare() { # log history #= gl -a__git_log() { +rwx_git_log() { git \ log \ --abbrev=8 \ @@ -306,24 +306,24 @@ a__git_log() { # log all history #= gla -a__git_log_all() { - a__git_log \ +rwx_git_log_all() { + rwx_git_log \ --all \ "${@}" } # log all history as oneline #= glao -a__git_log_all_oneline() { - a__git_log_all \ +rwx_git_log_all_oneline() { + rwx_git_log_all \ --format="${RWX_GIT_LOG_FORMAT_SHORT}" \ "${@}" } # log all history with patches #= glap -a__git_log_all_patch() { - a__git_log \ +rwx_git_log_all_patch() { + rwx_git_log \ --all \ --patch \ "${@}" @@ -331,23 +331,23 @@ a__git_log_all_patch() { # log history as oneline #= glo -a__git_log_oneline() { - a__git_log \ +rwx_git_log_oneline() { + rwx_git_log \ --format="${RWX_GIT_LOG_FORMAT_SHORT}" \ "${@}" } # log history with patches #= glp -a__git_log_patch() { - a__git_log \ +rwx_git_log_patch() { + rwx_git_log \ --patch \ "${@}" } # fast-forward merge to remote branch #= gm -a__git_merge() { +rwx_git_merge() { git \ merge \ --ff-only \ @@ -356,7 +356,7 @@ a__git_merge() { # abort the current merge commit #= gma -a__git_merge_abort() { +rwx_git_merge_abort() { git \ merge \ --abort \ @@ -365,7 +365,7 @@ a__git_merge_abort() { # do a merge commit #= gmc -a__git_merge_commit() { +rwx_git_merge_commit() { git \ merge \ --no-ff \ @@ -375,7 +375,7 @@ a__git_merge_commit() { # squash a branch and index its modifications #= gms -a__git_merge_squash() { +rwx_git_merge_squash() { git \ merge \ --squash \ @@ -384,7 +384,7 @@ a__git_merge_squash() { # merge via external tool #= gmt -a__git_merge_tool() { +rwx_git_merge_tool() { git \ mergetool \ "${@}" @@ -392,7 +392,7 @@ a__git_merge_tool() { # push to the remote repository #= gp -a__git_push() { +rwx_git_push() { rwx_gpg_agent_update && git \ push \ @@ -403,7 +403,7 @@ a__git_push() { # delete from the remote repository #= gpd -a__git_push_delete() { +rwx_git_push_delete() { git \ push \ --delete \ @@ -412,15 +412,15 @@ a__git_push_delete() { # force the push to the remote repository #= gpf -a__git_push_force() { - a__git_push \ +rwx_git_push_force() { + rwx_git_push \ --force \ "${@}" } # rebase current branch onto another #= grb -a__git_re_base() { +rwx_git_re_base() { git \ rebase \ "${@}" @@ -428,7 +428,7 @@ a__git_re_base() { # abort current rebase #= grba -a__git_re_base_abort() { +rwx_git_re_base_abort() { git \ rebase \ --abort \ @@ -437,7 +437,7 @@ a__git_re_base_abort() { # continue current rebase #= grbc -a__git_re_base_continue() { +rwx_git_re_base_continue() { git \ rebase \ --continue \ @@ -446,7 +446,7 @@ a__git_re_base_continue() { # force rebase without fast-forward #= grbf -a__git_re_base_force() { +rwx_git_re_base_force() { git \ rebase \ --force-rebase \ @@ -455,7 +455,7 @@ a__git_re_base_force() { # rebase interactively #= grbi -a__git_re_base_interactive() { +rwx_git_re_base_interactive() { git \ rebase \ --interactive \ @@ -464,7 +464,7 @@ a__git_re_base_interactive() { # add a new remote repository #= grma -a__git_re_mote_add() { +rwx_git_re_mote_add() { git \ remote \ add \ @@ -473,7 +473,7 @@ a__git_re_mote_add() { # list remote repositories #= grml -a__git_re_mote_list() { +rwx_git_re_mote_list() { git \ remote \ --verbose \ @@ -482,7 +482,7 @@ a__git_re_mote_list() { # set the location of a remote repository #= grmsu -a__git_re_mote_set_upstream() { +rwx_git_re_mote_set_upstream() { git \ remote \ set-url \ @@ -491,7 +491,7 @@ a__git_re_mote_set_upstream() { # show connection to a remote repository #= grms -a__git_re_mote_show() { +rwx_git_re_mote_show() { git \ remote \ show \ @@ -500,7 +500,7 @@ a__git_re_mote_show() { # remove and add removal to index #= grm -a__git_re_move() { +rwx_git_re_move() { git \ rm \ "${@}" @@ -508,7 +508,7 @@ a__git_re_move() { # remove file(s) from index or move current branch pointer #= grs -a__git_re_set() { +rwx_git_re_set() { git \ reset \ "${@}" @@ -516,7 +516,7 @@ a__git_re_set() { # wipe modifications or reset current branch to another commit #= grsh -a__git_re_set_hard() { +rwx_git_re_set_hard() { git \ reset \ --hard \ @@ -525,7 +525,7 @@ a__git_re_set_hard() { # current state of repository #= gs -a__git_status() { +rwx_git_status() { git \ status \ --untracked-files="all" \ @@ -534,7 +534,7 @@ a__git_status() { # show a commit #= gsc -a__git_show_commit() { +rwx_git_show_commit() { git \ show \ "${@}" @@ -542,7 +542,7 @@ a__git_show_commit() { # tag a commit #= gt -a__git_tag() { +rwx_git_tag() { git \ tag \ "${@}" @@ -550,7 +550,7 @@ a__git_tag() { # delete a tag #= gtd -a__git_tag_delete() { +rwx_git_tag_delete() { git \ tag \ --delete \ @@ -559,7 +559,7 @@ a__git_tag_delete() { # update head ref #= gurh -a__git_update_ref_head() { +rwx_git_update_ref_head() { if [ -n "${2}" ]; then git \ update-ref \