Crates.io | repos-tool |
lib.rs | repos-tool |
version | 0.1.4 |
source | src |
created_at | 2018-09-09 14:44:53.789072 |
updated_at | 2018-11-22 12:20:57.896343 |
description | A simple command line tool to manage local repositories. |
homepage | https://github.com/zhangkaizhao/repos |
repository | https://github.com/zhangkaizhao/repos |
max_upload_size | |
id | 83757 |
size | 50,410 |
A simple command line tool to manage local repositories.
Metadata file is managed by user self manually
The metadata of local repository should be managed by user self manually.
The repos
command line tool only reads the metadata for operations and never modifies it.
Please take a look at https://github.com/toml-lang/toml to get a quick introduction of toml format.
Vcs support is done by spawning vcs process
Currently, the repos
command line tool calls vcs process for synchronizing repositories.
Please make sure to put vcs command line programs in the path environment before using repos
command line to synchronizing repositories.
First, install Rust https://www.rust-lang.org/install.html .
Then,
cargo build --release
Copy the built
target/release/repos
(target\release\repos.exe
in Windows)
command line executable program to any place for use.
See Repos.sample.toml
for sample.
To use the sample metadata file, just copy it to the root directory of your repositories and rename it to Repos.toml
.
Repos.toml
repos sync {repo_url}
Run repos sync {repo_url}
.
repos remove {repo_url}
Repos.toml
manuallyRun repos sync
.
Run repos topic {topic}
.
Run repos topics
.
Run repos stats
.
Run repos cleanup
.
Run repos search {keyword}
.
Run repos proxy
.
Edit proxy
section in metadata file.
See Repos.template.toml
for an overview.
url
: follow usage of vcsvcs
: version control system. choices: git, hgallow_sync
: whether synchronized to local, or just marked in metadatabare
: whether bareuse_proxy
: whether using proxy for synctopics
: topics belong toscheme
: choices: http, socks5host
port
These files and directories are all in current/working directory (pwd
).
Repos.toml
{host}/{path_to_repo}
e.g. repository directory of url https://example.com/org/repo.git
is example.com/org/repo
.
sync
: update or clone if a repository url provided, else synchronize all repositoriesremove
: remove local directory of a repositorytopics
: list all topics with count of their repositoriestopic
: list repositories of a topicstats
: output stats of all repositoriescleanup
: clean up unused resourcessearch
: search repositories by keywordproxy
: output proxy configurationExamples:
repos sync https://github.com/org/repo.git
repos sync
repos remove https://github.com/org/repo.git
repos topics
repos topic rust
repos stats
repos cleanup
repos search keyword
repos proxy
There are some limitations now.
Relative URLs without base (scp-like syntax) are not supported.
e.g. [user@]host.xz:path/to/repo.git
or [user@]host.xz:~/path/to/repo.git
The bare
attribute of a repository is only used for cloning the repository.
Proxy configuration is global. This may be changed in the future.
Vcs only supports git and hg(Mercurial) now.