-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommit.sh
More file actions
executable file
·42 lines (31 loc) · 1005 Bytes
/
commit.sh
File metadata and controls
executable file
·42 lines (31 loc) · 1005 Bytes
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/bash
line=' ========= '
if [ -z "$1" ]; then
echo "$line"" Commit message is empty. Can not be comitted ""$line"
exit 1
fi
echo ""
echo $line' add files (*.xcscheme *.h *.m *.mm *.xib *.strings *.plist *.png *.jpg *.txt *.sh *.pbxproj *.proto *.zip) '$line
git add *.txt *.json *.pb *.pch *.c *.pb *.xcscheme *.proto *.h *.m *.mm *.xib *.strings *.plist *.png *.jpg *.txt *.sh *.pbxproj *.zip .gitignore
echo ''
echo $line' auto checkout unuse files (*xcbkptlist *xcuserstate *DS_Store) '$line
git checkout *xcbkptlist
git checkout *xcuserstate
git checkout *DS_Store
echo ''
echo $line' oh, commit files. comment: '"$1"" "$line
git commit -m "$1"
echo ''
if [ x$2 = x ]
then
echo $line' hey, pull code from server '$line
git pull origin master
echo ''
else
echo $line' Skip pull from server '$line
fi
echo $line' wow, push code to server '$line
git push
echo ''
echo $line' congratulations! hope there is no conflict! '$line
echo ''