diff --git a/git_helper.py b/git_helper.py index 9cf21104..eb7e3a9e 100644 --- a/git_helper.py +++ b/git_helper.py @@ -135,9 +135,9 @@ def switch_to_default_branch(repo): repo.git.checkout(repo.heads.master) except: try: - repo.git.checkout(repo.heads.main) + repo.git.checkout('-b', 'master', 'origin/master') except: - print("[ComfyUI Manager] Failed to switch to the default branch (master or main)") + print("[ComfyUI Manager] Failed to switch to the default branch") def gitpull(path): diff --git a/glob/manager_core.py b/glob/manager_core.py index f630627f..8814f507 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -1571,9 +1571,9 @@ def switch_to_default_branch(repo): repo.git.checkout(repo.heads.master) except: try: - repo.git.checkout(repo.heads.main) + repo.git.checkout('-b', 'master', 'origin/master') except: - print("[ComfyUI Manager] Failed to switch to the default branch (master or main)") + print("[ComfyUI Manager] Failed to switch to the default branch") def try_install_script(url, repo_path, install_cmd, instant_execution=False):