Package API
All of the command-line interface functionality is available from the Python package by importing gitman
.
Install
To clone/checkout the specified dependencies, call:
gitman.install(*names, root=None, depth=None, force=False, fetch=False, clean=True)
with optional arguments:
*names
: optional list of dependency directory names to filter onroot
: specifies the path to the root working treedepth
: number of levels of dependencies to traverseforce
: indicates uncommitted changes can be overwrittenfetch
: indicates the latest branches should always be fetchedclean
: indicates untracked files should be deleted from dependencies
Update
If any of the dependencies track a branch (rather than a specific commit), the current upstream version of that branch can be checked out by calling:
gitman.update(*names, root=None, depth=None, recurse=False, force=False, clean=True, lock=None)
with optional arguments:
*names
: optional list of dependency directory names to filter onroot
: specifies the path to the root working treedepth
: number of levels of dependencies to traverserecurse
: indicates nested dependencies should also be updatedforce
: indicates uncommitted changes can be overwrittenclean
: indicates untracked files should be deleted from dependencieslock
: indicates actual dependency versions should be recorded
List
To display the currently checked out dependencies, call:
gitman.list(root=None, depth=None, allow_dirty=True)
with optional arguments:
root
: specifies the path to the root working treedepth
: number of levels of dependencies to traverseallow_dirty
: causes uncommitted changes to be ignored
Lock
To record the exact versions of currently checked out dependencies, call:
gitman.lock(*names, root=None)
with optional arguments:
*names
: optional list of dependency directory names to filter onroot
: specifies the path to the root working tree
Uninstall
To delete all dependencies, call:
gitman.uninstall(root=None, force=False)
with optional arguments:
root
: specifies the path to the root working treeforce
: indicates uncommitted changes can be overwritten