-
Notifications
You must be signed in to change notification settings - Fork 0
/
clone.py
41 lines (28 loc) · 923 Bytes
/
clone.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
repo_git_list = [
]
import os
for i in repo_git_list:
print("-------------------------------").format(i)
i_a = i.split("/")
i_b = i_a[1].split(".")
repo = i_b[0]
# remove_remote = "git remote remove {}".format(repo)
# print(remove_remote)
# os.system(remove_remote)
add_remote = "git remote add {} {}".format(repo, i)
print(add_remote)
os.system(add_remote)
# gitpu = "git pu"
# print(add_remote)
# os.system(add_remote)
git_reset = "git reset --hard"
os.system(git_reset)
git_clean = "git clean -fd"
os.system(git_clean)
checkout_remote = "git checkout {}/master".format(repo)
print(checkout_remote)
os.system(checkout_remote)
checkout_remote_local = "git checkout -b {}".format(repo)
os.system(checkout_remote_local)
git_push_origin = "git push --set-upstream origin {}" .format(repo)
os.system(git_push_origin)