-
Notifications
You must be signed in to change notification settings - Fork 1
/
git.sh
executable file
·86 lines (73 loc) · 1.62 KB
/
git.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
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
77
78
79
80
81
82
83
84
85
# #!/bin/bash
# echo "
# -------------------------------------
# Running Git Commands for SLC Project
# -------------------------------------"
# git status
# git add *
# git commit -m "Creating Website"
# git push
# echo "
# -------------------
# Command Completed!!
# -------------------"
# echo "
# ----------------------
# Running Node Js Server
# ----------------------
# "
# npm start
# exit 0
#!/bin/bash
echo "
--------------------------------------------------------------------------
Project Name: Shafiq Law Chamber
Author: Abdul Rafay
GitHub Repo: https://github.com/1-Power/Shafiq-Law-Chamber.git
Website URL: https://shafiqlawchamber.com
Operating System: Arch Linux
------------------------------------------------------------------------
"
# This function will check status && will add all of the files
function git_status()
{
git status
git add *
}
function git_commit()
{
echo "
----------------------------------------
Enter your Commit Message:
----------------------------------------
"
read message
git commit -m "$message"
}
# This is the Push function
function git_push()
{
git push
}
function main()
{
branch="git branch --show-current"
if [[ $branch == "main" ]];then
echo "
---------------------------------------
You are on the main Branch
So Code is commited to the main branch
--------------------------------------"
git pull
else
echo "
-----------------------------
You are on $branch
-----------------------------"
git_status
git_commit
git_push
fi
}
#This is the running Point
main