class_docstr: Creates an instance of a remote Git repo for mounting to a submitted run.
  
  Using a locally checked-out remote Git repo:
  
  ```python
  repo=RemoteRepo.from_dir(repo_dir=".")
  ```
  
  Using a remote Git repo by a URL:
  
  ```python
  repo=RemoteRepo.from_url(
      repo_url="https://github.com/dstackai/dstack-examples",
      repo_branch="main"
  )
  ```
  
  Initialize the repo before mounting it.
  
  ```python
  client.repos.init(repo)
  ```
  
  By default, it uses the default Git credentials configured on the machine.
  You can override these credentials via the `git_identity_file` or `oauth_token` arguments of the `init` method.
  
  Finally, you can pass the repo object to the run:
  
  ```python
  run = client.runs.submit(
      configuration=...,
      repo=repo,
  )
  ```
docstr: Creates an instance of a remote repo from a local path.
  
  Args:
      repo_dir: The path to a local folder
  
  Returns:
      A remote repo instance
docstr_tok: ["Creates","an","instance","of","a","remote","repo","from","a","local","path",".","Args",":","repo_dir",":","The","path","to","a","local","folder","Returns",":","A","remote","repo","instance"]
code: def from_dir(repo_dir: PathLike) -> "RemoteRepo":
      """
      Creates an instance of a remote repo from a local path.
  
      Args:
          repo_dir: The path to a local folder
  
      Returns:
          A remote repo instance
      """
      return RemoteRepo(local_repo_dir=repo_dir)
  
imports: import io
  import subprocess
  import time
  from typing import BinaryIO, Optional
  import git
  import giturlparse
  from pydantic import BaseModel, Field
  from typing_extensions import Literal
  from dstack._internal.core.errors import DstackError
  from dstack._internal.core.models.repos.base import BaseRepoInfo, Repo, RepoProtocol
  from dstack._internal.utils.hash import get_sha256, slugify
  from dstack._internal.utils.path import PathLike
  from dstack._internal.utils.ssh import get_host_config
label_desc: Use image node_id 1 for calling the RemoteRepo obj's underlying member method code with example usage: obj.from_dir(repo_dir) and returns: RemoteRepo