MCPcopy Create free account
hub / github.com/modelscope/modelscope / push

Method push

modelscope/hub/git.py:136–149  ·  view source on GitHub ↗
(self,
             repo_dir: str,
             git_token: str,
             url: str,
             local_branch: str,
             remote_branch: str,
             force: bool = False)

Source from the content-addressed store, hash-verified

134 return self._run_git_command('-C', repo_dir, 'pull', remote, branch)
135
136 def push(self,
137 repo_dir: str,
138 git_token: str,
139 url: str,
140 local_branch: str,
141 remote_branch: str,
142 force: bool = False):
143 auth_url = self._add_git_token(git_token, url)
144 args = [
145 '-C', repo_dir, 'push', auth_url, f'{local_branch}:{remote_branch}'
146 ]
147 if force:
148 args.append('-f')
149 return self._run_git_command(*args)
150
151 # ------------------------------------------------------------------
152 # Add / commit / branch / checkout

Callers

nothing calls this directly

Calls 3

_add_git_tokenMethod · 0.95
_run_git_commandMethod · 0.95
appendMethod · 0.45

Tested by

no test coverage detected