workset is yet another tool for managing your local git repos.
| Glossary | |
|---|---|
| Workspace | Local directory where you clone Git repositories. Initialized with workset init. |
| Library | Local directory (default: ~/.workset) where workset keeps your repos when they're not in your workspace. |
| Working Set | Set of repos in your workspace at any given time. |
| Drop | Move a repo from your workspace to the library. The repo disappears from your workspace, but remains in the library. Only "clean" repos without uncommitted changes can be dropped. |
| Restore | Bringing a repos from the library back into your workspace. |
Quickstart
All workset commands run in reference to the current directory.
# Initialize a new workspace in the current directory
❯ workset init
# Add (clone) a repository to your workspace
❯ workset github.com/jqlang/jq
# The repository's local path always reflects the remote path
❯ cd ./github.com/jqlang/jq
# Drop the repo from the working set (it remains in the library: ~/.workset)
❯ cd ..
❯ workset drop ./jq
# Or, you can drop all repositories in the current directory (any that have
# unpushed changes will not be touched).
❯ workset drop
# If you don't want a repo to remain in the library, use --delete
❯ workset drop --delete ./delete_this_repo
# When you need to work on a repository again, it's restored from the local library
❯ workset jq
The shell autocomplete is smart enough to look at your CWD and suggest repos that you might want to restore into your working set. Repos that were dropped most recently are prioritized.
Keep your working set small
The point of dropping repos out of your workspace is to avoid the inevitable accumulation of stagnant repos.
By keeping your working set small, you reduce the cognitive (and CPU) load required to search through your repos. It also makes it easier to see which repos have outstanding changes that need to be finished and pushed.
Adhering to this principle manually involves frequently cloning and deleting repositories from your workspace which is probably more effort wasted than saved.
workset makes these mechanics fast and easy. When repositories are dropped from your workspace, they are just saved locally in a library so restoring them later can be done in an instant.
Control your repos
Don't let Github be the only place you store your repos!
Workset makes it easy to keep local copies of all of your repos without having to sift through them to find the ones you're currently working on. Mirroring repos to other hosting providers is also supported.
Installation
Crates.io
Install from crates.io
cargo install workset