@@ -265,7 +265,7 @@ def pushGitModel(cls, gPath, modelName=None, projectName=None):
265265 mr .import_model_from_zip (modelName , projectName , zipIOFile )
266266
267267 @classmethod
268- def gitRepoPush (cls , gPath , commitMessage , branch = "origin" ):
268+ def gitRepoPush (cls , gPath , commitMessage , remote = "origin" , branch = "main " ):
269269 """Create a new commit with new files, then push changes from the local repository to a remote
270270 branch. The default remote branch is origin.
271271
@@ -275,14 +275,15 @@ def gitRepoPush(cls, gPath, commitMessage, branch="origin"):
275275 Base directory of the git repository.
276276 commitMessage : string
277277 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'
280282 """
281283 repo = Repo (gPath )
282284 repo .git .add (all = True )
283285 repo .index .commit (commitMessage )
284- pushBranch = repo .remote (name = branch )
285- pushBranch .push ()
286+ repo .git .push (remote , branch )
286287
287288 @classmethod
288289 def gitRepoPull (cls , gPath , remote = "origin" , branch = "main" ):
0 commit comments