Created
January 21, 2016 07:53
-
-
Save byrnedo/6dd20b48832984b7801a to your computer and use it in GitHub Desktop.
Find Repo: Git repo fuzzy find (uses Fzf)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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