-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpush
executable file
·40 lines (33 loc) · 1.05 KB
/
gpush
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
#!/bin/zsh
# Catch any input that is invalid.
if [[ $# -eq 0 ]]; then
echo "\nImproper usage. Try:"
echo "\ngpush [ \"message\" | -h | --help ]"
echo " gpush \"init commit\""
echo " gpush -l \"init commit\""
echo " gpush --local \"init commit\""
echo " gpush -h"
echo " gpush --help"
exit
# Display help.
elif [[ $1 == "-h" || $1 == "--help" ]]; then
echo "\nMaking the Git command line tool easier to use with simpler commands."
echo "User must provide an argument. The argument must be wrapped in \"\" symbols."
echo "\n\nUsage:"
echo "\ngit-push [ \"message\" | -h | --help ]"
echo " gpush \"init commit\""
echo " gpush -l \"init commit\""
echo " gpush --local \"init commit\""
echo " gpush -h"
echo " gpush --help"
exit
# Commit changes to local repository.
elif [[ $1 == "-l" || $1 == "--local" ]]; then
git stage -A
git commit -m "$2"
# Push changes to remote repository.
else
git stage -A
git commit -m "$1"
git push
fi