From 258d04621824cb5eb5ec2b158b30b871bd697d9b Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 20 Oct 2023 23:13:09 -0700 Subject: [PATCH] More robust way of initializing empty .git folder --- one_click.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/one_click.py b/one_click.py index 2da76055..ae84cce1 100644 --- a/one_click.py +++ b/one_click.py @@ -198,7 +198,7 @@ def install_webui(): def update_requirements(initial_installation=False): # Create .git directory if missing if not os.path.isdir(os.path.join(script_dir, ".git")): - git_creation_cmd = 'git init -b main && git remote add origin https://github.com/oobabooga/text-generation-webui && git fetch && git remote set-head origin -a && git reset origin/HEAD && git branch --set-upstream-to=origin/HEAD' + git_creation_cmd = 'git init -b main && git remote add origin https://github.com/oobabooga/text-generation-webui && git fetch && git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main && git reset --hard origin/main && git branch --set-upstream-to=origin/main' run_cmd(git_creation_cmd, environment=True, assert_success=True) files_to_check = [