Crates.io | gitrs |
lib.rs | gitrs |
version | 0.3.5 |
source | src |
created_at | 2020-12-30 05:49:22.593483 |
updated_at | 2023-06-21 01:26:16.372474 |
description | A simple, opinionated, tool, written in Rust, for declaratively managing Git repos on your machine. |
homepage | https://github.com/mccurdyc/gitrs |
repository | https://github.com/mccurdyc/gitrs |
max_upload_size | |
id | 329128 |
size | 229,934 |
A simple, opinionated, tool, written in Rust, for declaratively managing Git repos on your machine.
"simple" - limited in what it supports. For example, won't support running commands
against repos.
"opinionated" - similar to Go and the old $GOPATH
is how repos are stored.
cargo
cargo install gitrs
nixpkgs
TODO
Environment variables
GITRS_ROOT
- (default: $HOME/src
). Path managed by gitrs.SSH_PRIVKEY_PATH
- (default: $HOME/.ssh/id_rsa
). Path to your SSH private key.SSH_PRIVKEY_PASS
- (default: ""
). SSH private key passphrase.Global arguments
--root <path>
- specify $GITRS_ROOT
. Defaults to $HOME/src
.Subcommands
add <url>
- adds repo to the config file.remove <url>
- remove repo from the config file.sync
- reads the config file and adds or removes repos from the filesystem
to match the state of the config.gitrs uses standard leveled logs, so RUST_LOG=<debug,info,warn,error>; gitrs ...
reports the requested logs.
$GITRS_ROOT/.gitrs.yaml
config filemetadata:
version: v1beta
root: /home/user/src
last_sync: <timestamp>
repos:
- name: github.com/mccurdyc/gitrs
pin: <true|default:false>
sha: <sha>
$GOPATH
. But you can specify a GITRS_ROOT
.$HOME/{work,personal}
with separate gitrs configs.add
, it adds the repo to the config file.remove
, it removes the repo from the config file.sync
clones the repo and/or updates the filesystem to reflect
the state of the config file.gitrs
you can parse for use in another tooladd --pin [<SHA>]
pinning / skipping a repo from being checked for updates.sync --clean
- only remove repositories, doesn't update or clone.sync --archive
- archives repositories, to $GITRS_ROOT/.archived
.watch
- watches the config file for updates and syncs the filesystem.list
- lists repos in the config file.status
- checks to see if cloned repos, need removed and/or if
remote updates need fetched.add
to support multiple repos.mv src/ src.bak/
for d in ~/src.bak/github.com/org/*; do
gitrs add $(echo ${d##*src.bak/})
done
gitrs sync
See similar projects.
See LICENSE.md.