Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -64,8 +64,9 @@ def push_to_github(local_path, repo, github_token):
|
|
64 |
# 🚀 Pushing code to GitHub. Blast off!
|
65 |
repo_url = f"https://{github_token}@github.com/{repo.full_name}.git"
|
66 |
local_repo = Repo(local_path)
|
67 |
-
|
68 |
-
|
|
|
69 |
origin = local_repo.remote('origin')
|
70 |
origin.set_url(repo_url)
|
71 |
else:
|
|
|
64 |
# 🚀 Pushing code to GitHub. Blast off!
|
65 |
repo_url = f"https://{github_token}@github.com/{repo.full_name}.git"
|
66 |
local_repo = Repo(local_path)
|
67 |
+
if 'origin' in [remote.name for remote in local_repo.remotes]:
|
68 |
+
|
69 |
+
#if 'origin' in [remote.name for remote.local_repo.remotes]: --error
|
70 |
origin = local_repo.remote('origin')
|
71 |
origin.set_url(repo_url)
|
72 |
else:
|