-
Notifications
You must be signed in to change notification settings - Fork 0
/
beginnerGit.sh
36 lines (28 loc) · 885 Bytes
/
beginnerGit.sh
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
#!/bin/bash
yellow=`tput setaf 3`
blue=`tput setaf 4`
red=`tput setaf 1`
cyan=`tput setaf 6`
magenta=`tput setaf 5`
reset=`tput sgr0`
drawLine (){
for (( i=1; i<=40; i++ ))
do
printf "-"
done
}
cd .git_engine/
while [[ $BRANCHING -lt 1 || $BRANCHING -gt 3 ]]; do
printf "${cyan}1. Pull Changes\n2. Commit New Changes\n${red}3. Print Log${reset}\n$(drawLine)\n${reset}"
read -p "${cyan}What you wanna do?:${reset}" BRANCHING
if [[ $BRANCHING == 1 ]]; then
clear && bash sync.sh
elif [[ $BRANCHING == 2 ]]; then
clear && bash push.sh
elif [[ $BRANCHING == 3 ]]; then
clear && git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
else
echo "Please, input only 1, 2 or 3!"
sleep 1 && clear
fi
done