CheeksTheGeek commited on
Commit
e16482d
·
unverified ·
1 Parent(s): e8eec7d

Fix: Rename master to main before push

Browse files
Files changed (1) hide show
  1. student/github_manager.py +6 -0
student/github_manager.py CHANGED
@@ -154,6 +154,12 @@ class GitHubManager:
154
  commit = repo.index.commit("Initial commit: Generated application")
155
  commit_sha = commit.hexsha
156
 
 
 
 
 
 
 
157
  # Add remote
158
  remote_url = f"https://{settings.github_token}@github.com/{settings.github_username}/{repo_name}.git"
159
  try:
 
154
  commit = repo.index.commit("Initial commit: Generated application")
155
  commit_sha = commit.hexsha
156
 
157
+ # Rename master to main if needed
158
+ try:
159
+ repo.git.branch("-M", "main")
160
+ except Exception:
161
+ pass # Already on main or error, continue
162
+
163
  # Add remote
164
  remote_url = f"https://{settings.github_token}@github.com/{settings.github_username}/{repo_name}.git"
165
  try: