remote¶

For git-remote(1).

Overview¶

Manage git remotes using GitRemoteManager (collection-level) and GitRemoteCmd (per-remote operations).

Example¶

from libvcs.cmd.git import Git

git = Git(path='/path/to/repo')

# List all remotes
remotes = git.remotes.ls()

# Add a new remote
git.remotes.add(name='upstream', url='https://github.com/org/repo.git')

# Get a specific remote and operate on it
origin = git.remotes.get(remote_name='origin')
origin.show()
origin.prune()
origin.set_url('https://new-url.git')

API Reference¶

class libvcs.cmd.git.GitRemoteManager
¶

Bases: object

Traverse and manage git remotes with ORM-like filtering via QueryList.

class libvcs.cmd.git.GitRemoteCmd
¶

Bases: object

Run git commands targeting a specific remote.