Add new git commands

This commit is contained in:
Digital Studium 2024-04-06 17:19:39 +03:00
parent 35af86de58
commit 0e8df7e6d5
1 changed files with 9 additions and 6 deletions

13
g
View File

@ -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
elif [[ $action == "Add all && Commit" ]]; then
git add .
elif [[ $action == "Commit" ]]; 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"
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