Skip to content

Commit c5ec72f

Browse files
authored
Update push.sh
1 parent 847051c commit c5ec72f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

git/push.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ echo -e "${BCyan}# Git Push Script #${RESET_COLOR}"
5454
echo -e "${BCyan}#############################${RESET_COLOR}"
5555

5656
# get branch name (e.g master, main, etc... ) #
57-
Branch=$(git branch --show-current)
57+
Branch=$(git branch --show-current)
58+
DEFAULT_COMMIT_MSG=$(git status -s)
5859

5960
echo -e "\n${BRed}[*] Your Current Branch : ${BYellow}${Branch}${RESET_COLOR}"
6061

@@ -69,20 +70,19 @@ echo -e "\n${BPurple}[+] Adding new changes to the repo... \n${RESET_COLOR}"
6970
git add --all .
7071

7172
if [ "$1" == "-m" ];
72-
then
73-
# commit changes#
74-
echo ""
75-
git commit -m "$2"
73+
74+
then
75+
76+
# commit changes#
77+
echo ""
78+
git commit -m "$2"
79+
7680
else
77-
# read commit comment from user #
78-
echo ""
79-
echo -e "${BPurple}##################################${RESET_COLOR}"
80-
echo -e "${BPurple}# Write your commit comment! :- #${RESET_COLOR}"
81-
read yourCommit
8281

83-
# commit changes#
82+
# use the default commit msg #
8483
echo ""
85-
git commit -m "$yourCommit"
84+
git commit -m "updated/added ${DEFAULT_COMMIT_MSG}"
85+
8686
fi
8787

8888
# push to repo #

0 commit comments

Comments
 (0)