Skip to content

Commit dd86e92

Browse files
committed
docs(GitRepo): Document checkout
1 parent b1ff274 commit dd86e92

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

libvcs/git.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,42 @@ def __init__(self, url: str, repo_dir: str, remotes: RemotesArgs = None, **kwarg
148148
149149
tls_verify : bool
150150
Should certificate for https be checked (default False)
151+
152+
Examples
153+
--------
154+
155+
.. code-block:: python
156+
157+
import os
158+
from libvcs.git import GitRepo
159+
160+
checkout = os.path.dirname(os.path.abspath(__name__)) + '/' + 'my_libvcs'
161+
162+
repo = GitRepo(
163+
url="https://github.com/vcs-python/libvcs",
164+
repo_dir=checkout,
165+
remotes={
166+
'gitlab': 'https://gitlab.com/vcs-python/libvcs'
167+
}
168+
)
169+
170+
.. code-block:: python
171+
172+
import os
173+
from libvcs.git import GitRepo
174+
175+
checkout = os.path.dirname(os.path.abspath(__name__)) + '/' + 'my_libvcs'
176+
177+
repo = GitRepo(
178+
url="https://github.com/vcs-python/libvcs",
179+
repo_dir=checkout,
180+
remotes={
181+
'gitlab': {
182+
'fetch': 'https://gitlab.com/vcs-python/libvcs',
183+
'push': 'https://gitlab.com/vcs-python/libvcs',
184+
},
185+
}
186+
)
151187
"""
152188
if "git_shallow" not in kwargs:
153189
self.git_shallow = False

0 commit comments

Comments
 (0)