Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

src

A tool for managing repositories.

Installation

Cargo

Cargo instructions…

Nix

Nix instructions…

Configuration

To override the default values, configuration can be passed in as optional arguments, read from environment variables, or from a configuration file, with values taking precedence in that order.

To see which optional parameters are available, run src [COMMAND] --help.

To pass configuration options as environment variables, prefix the name of the option with SRC_. For example, to override the location of the root_directory, set the value of SRC_ROOT_DIRECTORY.

The default location for the configuration file is $XDG_CONFIG_HOME/src/config.toml. To use a configuration file at a different location, pass a path to --config-file as an option.

The available configuration options and their default values are shown below.

host = "github.com"
owner = "<git config github.user>"
root_directory = "$HOME/src"

Commands

Add

Add repositories to the managed folder by passing paths to local repositories or git urls of remote repositories. Remote repositories will be cloned and local repositories moved (or copied with --copy) into the root_directory at the path: <root_directory>/<host>/<owner>/<name>. If a local path and a remote url represent the same repository, and are both passed simultaneously, the local path will be preferred, in order to preserve any local work that has not yet been pushed to the remote. If a repository is already managed by src, then it will skip it. Use --force to override this.

Git urls can be in the form <host>:\owner>/<name>, <owner>/<name>, or, simply, <name>. Any components that are missing will be filled in with values from the coniguration.

List

By default, list displays only managed repositories. To show unmanaged repositories on your system, use list unmanaged [--hidden], or list all to display both managed and non-managed repositories.

By default, list displays repositories in the form <host>:<owner>/<name>. To display the path, use --path. You can control which data is displayed by using --no-host, --no-owner, or by running list hosts, list owners, or list names (the same as --no-host --no-owner).

Default settings for list can be configured in the configuration file. See configuration.