-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit_script.sh
More file actions
44 lines (44 loc) · 1.24 KB
/
git_script.sh
File metadata and controls
44 lines (44 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
PS3='Git commands script: '
options=("Pull" "Status" "Add" "Commit" "Push" "History" "All deployment commands" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Pull")
git pull
;;
"Status")
git status
;;
"Add")
git add .
;;
"Commit")
echo "Commit message: "
read MSG
git commit -m "$MSG"
;;
"Push")
echo "Name of the branch: "
read BRANCH
git push origin $branch
;;
"History")
git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
;;
"All deployment commands")
git add .
echo "Commit message: "
read MSG
git commit -m "$MSG"
echo "Name of the branch: "
read BRANCH
git push origin $branch
;;
"Quit")
echo "See you. Bye bye!"
break
;;
*) echo "invalid option $REPLY";;
esac
REPLY=""
done