Skip to content

Instantly share code, notes, and snippets.

@byrnedo
Created January 21, 2016 07:53
Show Gist options
  • Save byrnedo/6dd20b48832984b7801a to your computer and use it in GitHub Desktop.
Save byrnedo/6dd20b48832984b7801a to your computer and use it in GitHub Desktop.
Find Repo: Git repo fuzzy find (uses Fzf)
# Add this to your bashrc/zshrc somewhere
# Set env FR_SEARCH_PATH to where you want fr to start looking from, otherwise it starts at current dir.
function fd() {
local startDir=${FR_SEARCH_PATH:=.}
local dir
dir=$(cd $startDir && find . -name *.git -type d -nowarn 2>/dev/null | sed 's/\(.*\)\/.git/\1/' | fzf) && cd "$startDir/$dir"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment