@@ -265,7 +265,7 @@ def pushGitModel(cls, gPath, modelName=None, projectName=None):
265
265
mr .import_model_from_zip (modelName , projectName , zipIOFile )
266
266
267
267
@classmethod
268
- def gitRepoPush (cls , gPath , commitMessage , branch = "origin" ):
268
+ def gitRepoPush (cls , gPath , commitMessage , remote = "origin" , branch = "main " ):
269
269
"""Create a new commit with new files, then push changes from the local repository to a remote
270
270
branch. The default remote branch is origin.
271
271
@@ -275,14 +275,15 @@ def gitRepoPush(cls, gPath, commitMessage, branch="origin"):
275
275
Base directory of the git repository.
276
276
commitMessage : string
277
277
Commit message for the new commit
278
- branch : str, optional
279
- Branch name for the remote repository, by default 'origin'
278
+ remote : str, optional
279
+ Remote name for the remote repository, by default 'origin'
280
+ branch : string
281
+ Branch name for the target pull branch from remote, by default 'main'
280
282
"""
281
283
repo = Repo (gPath )
282
284
repo .git .add (all = True )
283
285
repo .index .commit (commitMessage )
284
- pushBranch = repo .remote (name = branch )
285
- pushBranch .push ()
286
+ repo .git .push (remote , branch )
286
287
287
288
@classmethod
288
289
def gitRepoPull (cls , gPath , remote = "origin" , branch = "main" ):
0 commit comments