commit 67994f23b96b978f9c780d82b90887d2fcfaefb3 parent 727b6c909f938fb31fdc96cda75139f846a06f4b Author: Pablo Cárdenas <pablo.cardenas@imca.edu.pe> Date: Sun, 12 May 2024 02:48:25 -0500 bash: added git args to git function Diffstat:
| M | .bashrc | | | 17 | ++++++++++++++++- |
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/.bashrc b/.bashrc @@ -47,6 +47,15 @@ man() { } git() { + if [ $1 = "--git-dir" ]; then + local git_args="$git_args $1 $2" + shift 2 + fi + if [ $1 = "--work-tree" ]; then + local git_args="$git_args $1 $2" + shift 2 + fi + if [ $1 = "checkout" ]; then echo "Use" echo " - git checkout-index -fu" @@ -56,8 +65,14 @@ git() { echo " - git read-tree -mu" echo " - git read-tree -m" echo " - git update-index --add --remove --cacheinfo 100644 sha1 filename" + elif [ $1 = "status" -a $# = 1 ]; then + echo "Use" + echo " - git diff-files --name-only" + echo " - git diff-index --name-only HEAD" + echo " - git ls-files -mot" + echo " - git status -bs" else - command git "$@" + command git $git_args "$@" fi }