-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgitInit.py
66 lines (47 loc) · 1.82 KB
/
gitInit.py
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
#!/usr/bin/evn python3
#coding=utf-8
import os
import sys
def parseArgument():
# 1、提交仓库组名 2、项目名 3、提交消息备注
argus = []
for i in range(0,len(sys.argv)):
# print(sys.argv[i])
argus.append(sys.argv[i])
return argus
if __name__ == '__main__':
argus = parseArgument()
path =os.getcwd()
count = 0
for k, v in enumerate(argus):
# print k, v
count = count + 1
if count >2 and count >=4 :
#消息备注
mes = argus[1]
# 仓库组名
store = argus[2]
# 项目名
name = argus[3]
else:
#消息备注
mes = "没有备注"
# 仓库组名
store = "Garretming"
# 项目名
name = os.path.basename(path)
os.system('git remote add origin [email protected]:' + store +'/' + name +'.git')
os.system('rm -rf .git')
os.system('git init')
os.system('curl -u Garretming -d \'{"name":"slg_cilent","description":"slg_cilent is a cilent for slg games"}\' https://api.github.com/user/repos')
os.system('git remote add origin [email protected]:Garretming/slg_cilent.git')
# os.system('git submodule add [email protected]:Clark8/mj_server.git mj_server')
# os.system('git submodule add https://github.com/cloudwu/skynet.git skynet')
# os.system('git submodule add https://githu.com/simongog/sdsl-lite.git 3rd/sdsl-lite')
# os.system('git submodule add https://github.com/driedfruit/jenkins-minimal-perfect-hash.git 3rd/perfect-hash')
# os.system('git submodule add https://github.com/mpx/lua-cjson.git 3rd/cjson')
os.system('git add .')
# os.system('git pull --rebase')
os.system('git commit -m ' + '\"' + mes + '\"')
# os.system('git stash')
os.system('git push -u origin master')