From 652bd27924d5aa882afe065c41d3983bafd24a18 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Tue, 17 Sep 2024 08:58:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sync-gitee-to-github/sync.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sync-gitee-to-github/sync.py b/sync-gitee-to-github/sync.py index e9f900f..4946544 100644 --- a/sync-gitee-to-github/sync.py +++ b/sync-gitee-to-github/sync.py @@ -47,13 +47,13 @@ for i in repoList: 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'")