Skip to content

Latest commit

 

History

61 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License Build GitHub repo size Stars


workset is yet another tool for managing your local git repos.

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 a repository to your workspace
❯ workset clone github.com/jqlang/jq

# The repository's local path always reflects the remote pathcd ./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 restore 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.

Workset can mirror your pushed commits to the other remotes of a repo. Opt in per repo — press Ctrl+R on a repo in the TUI, or from the command line:

workset mirror init <repo>

Once enabled, all of the repo's remotes become mirrors. Push to any remote (from anywhere — inside or outside workset) and the others catch up in the background: the selected branches and tags are propagated, commits you haven't pushed anywhere are never touched, and diverged refs show an error instead of being force-pushed. Repos that haven't opted in are left alone entirely. By default the repo's default branch and all tags are mirrored; glob patterns select more (or fewer) refs:

workset mirror init <repo> --branches main --branches 'release/*' --tags 'v*'

workset mirror sync does the same from the command line, workset mirror sync --dryrun shows what would be pushed without pushing anything, and workset mirror sync --watch keeps syncing every few minutes.

Background pushes never prompt for credentials (SSH runs in batch mode), so use an SSH agent or credential helper for remotes that need authentication.

Installation

Crates.io

Crates.io Total Downloads

Install from crates.io

cargo install workset
Nixpkgs

Install from nixpkgs

Nixpkgs: nix-env -i workset

Shell completions

Completion scripts for bash and fish live in completions/.

# Bash: source it from ~/.bashrc (or copy into a bash-completion directory)
source /path/to/workset/completions/workset.bash

# Fish: copy it where fish autoloads completions
cp /path/to/workset/completions/workset.fish ~/.config/fish/completions/

Completions are generated dynamically by the workset binary itself: drop suggests repos in your workspace, and restore suggests repos in your library.

Releases

Used by

Contributors

Languages