forked from enli2222/JDDemo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommit.sh
executable file
·43 lines (30 loc) · 854 Bytes
/
commit.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
#!/bin/bash
line=' ===== '
if [ -z "$1" ]; then
echo "$line"" Commit message is empty. Please add commit message ""$line"
exit 1
fi
echo ""
echo $line' add files (*.h *.m *.json *.pch *.xcscheme *.xib *.plist *.sh *.pbxproj *.png *.proto) '$line
git add *.h *.m *.json *.pch *.xcscheme *.xib *.plist *.sh *.pbxproj *.png *.proto
echo ''
echo $line' checkout unuse files ( *xcuserstate *DS_Store) '$line
git checkout *xcuserstate
git checkout *DS_Store
echo ''
echo $line' Commit files. Comment: '"$1"" "$line
git commit -m "$1"
echo ''
if [ x$2 = x ]
then
echo $line' Pull code from server '$line
git pull
echo ''
else
echo $line' Skip pull from server '$line
fi
echo $line' Push code to server '$line
git push
echo ''
echo $line' Congratulations! Hope there is no conflict! '$line
echo ''