Skip to content

Commit

Permalink
调整策略
Browse files Browse the repository at this point in the history
  • Loading branch information
gfdgd-xi committed Sep 17, 2024
1 parent f25fd31 commit 652bd27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sync-gitee-to-github/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
if (not os.path.exists(f"{programPath}/git-clone")):
os.makedirs(f"{programPath}/git-clone")
print(f"======================> {pullUrl}/{i}")
os.system(f"cd '{programPath}/git-clone' ; git clone '{pullUrl}/{i}'")
os.system(f"cd '{programPath}/git-clone' ; git clone --bare '{pullUrl}/{i}'")
# 推送
for j in range(len(pushUrl)):
# git remote set-url origin
gitUrl = pushUrl[j].replace("@USER@", userName[j]).replace("@PASS@", password[j]) + "/" + i
os.system(f"cd '{programPath}/git-clone/{i}' ; git remote set-url origin '{gitUrl}'")
os.system(f"cd '{programPath}/git-clone/{i}' ; git push --mirror -f")
os.system(f"cd '{programPath}/git-clone/{i}.git' ; git remote set-url origin '{gitUrl}'")
os.system(f"cd '{programPath}/git-clone/{i}.git' ; git push --mirror")
# 移除临时文件
os.system(f"rm -rf '{programPath}/git-clone/{i}'")
os.system(f"rm -rf '{programPath}/git-clone/{i}.git'")

0 comments on commit 652bd27

Please sign in to comment.