From 0e8df7e6d5f0d2e526b39f69f4e6accda635586c Mon Sep 17 00:00:00 2001 From: Digital Studium Date: Sat, 6 Apr 2024 17:19:39 +0300 Subject: [PATCH] Add new git commands --- g | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/g b/g index 3224555..848130a 100755 --- a/g +++ b/g @@ -6,7 +6,7 @@ cat > /tmp/.dialogrc << EOL tag_color = (BLACK,WHITE,ON) EOL set +ex -action=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --menu "Choose the action for git" 10 40 0 'Add all && Commit && Push' 1 "Add all" 2 "Commit" 3 "Push" 4 "Status" 5) +action=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --menu "Choose the action for git" 10 40 0 'Add all && Commit && Push' 1 "Add all && Commit" 2 "Reset soft" 3 "Reset hard" 4 "Status" 5 "Clone submodules" 6) #echo $action #exit @@ -16,13 +16,16 @@ if [[ $action == "Add all && Commit && Push" ]]; then commit_message=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --title "$action" --inputbox "Enter the commit message:" 8 40) git commit -"m $commit_message" git push -elif [[ $action == "Add all" ]]; then - git add . -elif [[ $action == "Commit" ]]; then +elif [[ $action == "Add all && Commit" ]]; then + git add . commit_message=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --title "$action" --inputbox "Enter the commit message:" 8 40) git commit -"m $commit_message" -elif [[ $action == "Push" ]]; then - git push +elif [[ $action == "Reset soft" ]]; then + git reset +elif [[ $action == "Reset hard" ]]; then + git reset --hard elif [[ $action == "Status" ]]; then git status +elif [[ $action == "Clone submodules" ]]; then + git submodule update --init --recursive fi