Skip to content

Commit 39a38a9

Browse files
committed
docs(quickstart): add basic usage section
why: Provide getting-started examples beyond installation. what: - Add Commands section with git init/clone/status examples - Add Subcommand Managers section with branches/tags/remotes - Link to full API reference
1 parent 8e9c17e commit 39a38a9

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

docs/quickstart.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,49 @@ via trunk (can break easily):
5252

5353
[pip]: https://pip.pypa.io/en/stable/
5454
[uv]: https://docs.astral.sh/uv/
55+
56+
## Basic Usage
57+
58+
### Commands
59+
60+
Run git commands directly using {class}`~libvcs.cmd.git.Git`:
61+
62+
```python
63+
from libvcs.cmd.git import Git
64+
65+
git = Git(path='/path/to/repo')
66+
67+
# Initialize a new repository
68+
git.init()
69+
70+
# Clone a repository
71+
git.clone(url='https://github.com/vcs-python/libvcs.git')
72+
73+
# Check status
74+
git.status()
75+
```
76+
77+
### Subcommand Managers
78+
79+
Work with branches, tags, remotes, and more using the Manager/Cmd pattern:
80+
81+
```python
82+
from libvcs.cmd.git import Git
83+
84+
git = Git(path='/path/to/repo')
85+
86+
# List and filter branches
87+
branches = git.branches.ls()
88+
remote_branches = git.branches.ls(remotes=True)
89+
90+
# Create and manage tags
91+
git.tags.create(name='v1.0.0', message='Release 1.0')
92+
tag = git.tags.get(tag_name='v1.0.0')
93+
94+
# Work with remotes
95+
remotes = git.remotes.ls()
96+
origin = git.remotes.get(remote_name='origin')
97+
origin.prune()
98+
```
99+
100+
See {doc}`/cmd/git/index` for the full API reference.

0 commit comments

Comments
 (0)