alias git_ls_tree="git ls-tree --full-tree -r HEAD"
alias git_ls_files="git ls-files"
+gitcd() {
+ shell_help_noarg "Change directory to file's dirname\nUsage: $FUNCNAME GIT_ARGUMENTS" "$@" && return 1
+ local i d dir args
+ local pwd; pwd=$PWD
+ #for i in $@; do
+
+ while [ $# -gt 0 ]; do
+ i="$1"
+ # Replace file with realpath
+ if [ -e "$i" ]; then
+ i=$(realpath "$i")
+ d=$(dirname "$i")
+ [ -z "$dir" ] && cd "$d" || return
+ dir="$d"
+ fi
+ shell_push_arg "$i" args
+ shift
+ done
+ [ -z "$dir" ] && echo "Can't find any file in $@" && return 1
+ echo $dir
+ echo git ${args}
+ cd "$pwd"
+}
+
git_commit_push() {
git commit -a -m "$*" && git push #|| echo "Try: git push --set-upstream origin master"
}