Bash remote branch name completion reports an error if working copy 
contains a directory with the same name as remote name.


$ git remote
$ mkdir origin
$ git pull origin <Tab>fatal: Not a git repository: 'origin' 

The problem is in the __gitdir() function. I've replaced it's complex logic 
with a simpler implementation that just let git to decide where is the git 
__gitdir ()
if [ "$1" ]; then
pushd "$1" >/dev/null
# Current dir
git rev-parse --git-dir 2>/dev/null
if [ "$1" ]; then
popd >/dev/null

It's not a fix because I didn't analyzed the code, just updated as I've 
suggested it should work and it works for me.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to