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

Method config_git_token

modelscope/hub/git.py:91–97  ·  view source on GitHub ↗
(self, repo_dir: str, git_token: str)

Source from the content-addressed store, hash-verified

89 # Auth / user config
90 # ------------------------------------------------------------------
91 def config_git_token(self, repo_dir: str, git_token: str) -> None:
92 url = self.get_repo_remote_url(repo_dir)
93 if '//oauth2' in url:
94 return
95 auth_url = self._add_git_token(git_token, url)
96 self._run_git_command('-C', repo_dir, 'remote', 'set-url', 'origin',
97 auth_url)
98
99 def add_user_info(self, repo_base_dir: str, repo_name: str) -> None:
100 from modelscope.hub.api import ModelScopeConfig

Callers 3

__init__Method · 0.80
pushMethod · 0.80
pushMethod · 0.80

Calls 3

get_repo_remote_urlMethod · 0.95
_add_git_tokenMethod · 0.95
_run_git_commandMethod · 0.95

Tested by

no test coverage detected