Fuzzy clone (fz)

@kjuulh

2024-03-09

Fuzzy clone is a tool that I've used in a variety of incarnations, I've finally sat down and actually wrote a separate utility for it.

fuzzy-clone

It exists to solve one problem, and one problem only. Quickly clone, and jump to git repositories you collaborate to.

This gif should better display why this is so useful

fuzzy clone usage

Do note that , is my alias for it fz is the actual command. The fully qualified name is fuzzy-clone.

To get started simply:

brew install kjuulh/brew/fuzzy-clone
echo 'eval "$(fuzzy-clone init zsh)"' >> ~/.zshrc
fz

or follow the other options in the github repo.

Why I can't live without it anymore

This might be a bit ananas i egen juice (self gratification), but the alternative is horrid. I don't always remember the name of the repo I want to clone even if I've written it myself at some point.

  1. Go to https://github.com
  2. Click repositories, because the homepage search, doesn't always show all the repos I contribute to, or is a member of
  3. Search fuzzy-clone as an example.
  4. Open a terminal
  5. cd ~/git/github.com/kjuulh
  6. gh repo clone kjuulh/fuzzy-clone
  7. cd fuzzy-clone

Granted I've got a more complicated directory structure than most. But still there are like 7 steps. It may be small, but it takes around 30 seconds to a minute instead of 2 seconds using the utility. That is super valuable to me, and helps me everyday when I troubleshoot stuff in some of the repositories I don't technically own in my organisation

A bonus is that if the directory exists, I can just jump between them. Sort of like the zoxide zi tool but a bit more structured