-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGITup
76 lines (72 loc) · 1.58 KB
/
GITup
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
BLUE='\033[1;34m'
GREEN='\033[1;32m'
RED='\033[1;31m'
NC='\033[0m'
echo -e "${GREEN}\nThis script runs some basic GIT commands.${NC}"
echo -e "${RED}\nMenu:\n 0. TERMINAL\t 6. COMMIT\n 1. INIT\t 7. PUSH MASTER\n 2. ORIGIN\t 8. CREATE BRANCH\n 3. PULL \t 9. CHECKOUT TO BRANCH\n 4. STATUS \t 10. PUSH BRANCH\n 5. ADD \t 11. GIT FETCH\n${NC}"
echo -e -n "${BLUE}Enter a number from the above menu or any other value to exit: ${NC}"
read choice
case $choice in
1)
echo -e '\e[GIT init:\e[25m\n'
git init
;;
2)
echo -e '\e[GIT origin:\e[25m\n'
echo -n 'Enter GIT address: '
read address
eval 'git remote add origin $address'
;;
3)
echo -e '\e[5mCPull GIT files:\e[25m\n'
git pull origin master
;;
4)
echo -e '\e[5mCheck GIT status:\e[25m\n'
git status
;;
5)
echo -e '\e[5mAdd GIT files:\e[25m\n'
git add .
;;
6)
echo -e '\e[5mCommit GIT files:\e[25m\n'
echo -n 'Enter COMMIT message: '
read message
eval 'git commit -m "$message"'
;;
7)
echo -e '\e[5mPush Master GIT files:\e[25m\n'
git push origin master
;;
8)
echo -e '\e[5mCreate a Branch:\e[25m\n'
echo -n 'Enter BRANCH name: '
read branch
eval 'git branch "$branch"'
;;
9)
echo -e '\e[5mEnter a Branch:\e[25m\n'
echo -n 'Enter BRANCH name: '
read branch
eval 'git checkout "$branch"'
;;
10)
echo -e '\e[5mPush Branch GIT files:\e[25m\n'
echo -n 'Enter BRANCH name: '
read branch
eval 'git push origin "$branch"'
;;
11)
echo -e '\e[5mGIT fetch:\e[25m\n'
git fetch
;;
0)
exec /bin/bash
;;
*)
exit
;;
esac
source GITup