Command-line Interface
After setting up gitman
with a config file, various commands can be run to manage these Git-controlled source dependencies.
Init
To generate a sample config for a new project, run:
1 | $ gitman init |
Install
To clone/checkout the specified dependencies, run:
1 | $ gitman install |
or filter the dependency list by source or group name:
1 | $ gitman install <name1> <name2> <etc.> |
or limit the traversal of nested dependencies:
1 | $ gitman install --depth=<count>
|
It will leave untracked files alone. To delete them, run:
1 | $ gitman install --clean |
It will only fetch from the repository if needed. To always fetch, run:
1 | $ gitman install --fetch |
It will exit with an error if there are any uncommitted changes in dependencies or a post-install script fails. To overwrite all changes or ignore script failures, run:
1 | $ gitman install --force |
or to interactively overwrite changes, run:
1 | $ gitman install --force-interactive |
Alternatively, it is possible to skip the update process for dependencies that have uncommitted changes:
1 | $ gitman install --skip-changes |
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 running:
1 | $ gitman update |
or filter the dependency list by source or group name:
1 | $ gitman update <name1> <name2> <etc.> |
or limit the traversal of nested dependencies:
1 | $ gitman update --depth=<count>
|
This will also record the exact versions of any previously locked dependencies. Disable this behavior by instead running:
1 | $ gitman update --skip-lock |
or to additionally get the latest versions of all nested dependencies, run:
1 | $ gitman update --all |
It will exit with an error if there are any uncommitted changes in dependencies or a post-install script fails. To overwrite all changes or ignore script failures, run:
1 | $ gitman update --force |
or to interactively overwrite changes, run:
1 | $ gitman update --force-interactive |
Alternatively, it is possible to skip the update process only for dependencies that have uncommitted changes:
1 | $ gitman update --skip-changes |
List
To display the currently checked out dependencies, run:
1 | $ gitman list |
or exit with an error if there are any uncommitted changes:
1 | $ gitman list --fail-if-dirty |
The list
command will also record versions in the log file.
Lock
To manually record the exact version of each dependency, run:
1 | $ gitman lock |
or lock down specific sources or groups:
1 | $ gitman lock <name1> <name2> <etc.> |
To restore the exact versions previously checked out, run:
1 | $ gitman install |
Uninstall
To delete all dependencies, run:
1 | $ gitman uninstall |
If any dependencies contain uncommitted changes, instead run:
1 | $ gitman uninstall --force |
If you need to keep the top level folder and anything other than the dependencies:
1 | $ gitman uninstall --keep-location |
Show
To display the path to the dependency storage location:
1 | $ gitman show |
To display the path to a dependency:
1 | $ gitman show <name> |
To display the path to the config file:
1 | $ gitman show --config |
To display the path to the log file:
1 | $ gitman show --log |
Edit
To open the existing config file:
1 | $ gitman edit |