-
Notifications
You must be signed in to change notification settings - Fork 2
/
git.sh
executable file
·43 lines (36 loc) · 1.1 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
if [ "$2" == "" ];
then
echo -e "sh $0 <git commit -m > <git add >\nexample: sh $0 'update readme' 'README.md */*' "
exit
fi
commit=$1
add=$2
uname=`uname|grep MINGW|wc -l`
if [ "$uname" -eq 1 ];
then
find $add -type f -exec grep -Iq . {} \; -and -print|xargs -L 1 -I {} dos2unix {}
fi
set -vex
git add $add
git commit -m "$commit"
git push -u origin master
echo done
exit
#create new branch doc(default is in master branch)
git checkout -b doc # will cread new branch doc and switch to doc branch
# do some thing in branch doc then push to remote branch doc by
git push origin doc
# merge branch doc to master and swith to master branch by
git checkout master -m
## for first use git
#git init
#git add *
#git commit -m 'update'
#git remote add origin https://github.com/orangeSi/ClustersPloter.git
#git push -u origin master
#git pull origin master
# config password for git
#git config credential.helper store, store mean forver remember password. git config credential.helper 'cache –timeout=3600' for temperate remember password
# git push orgin master
# ......
# after this will remember the password