Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git completion not working #766

Closed
cpojer opened this issue Dec 21, 2011 · 24 comments
Closed

git completion not working #766

cpojer opened this issue Dec 21, 2011 · 24 comments

Comments

@cpojer
Copy link

cpojer commented Dec 21, 2011

git completion is not working. "git checkout bTAB" always tries to complete file names instead of branches etc.

I'm using git via homebrew (brew install git), version 1.7.8. It is located in /usr/local/Cellar/git/1.7.8

My .zshrc is pretty standard, the only plugin I have activated is "git"

@wilkerlucio
Copy link

here it's working, a little slow, but it can complete the branch names (including only remote ones)

@ajessu
Copy link

ajessu commented Dec 28, 2011

+1 on this.

Also, if I click ctrl+c, after clicking tab, it stops doing what it's parsing, and autocompletes instantly, so it must be trying to look for something else besides checking on branches to autocomplete (or not sure if it's the actual git, and not zsh, behavior that kicks in after clicking ctrl+c)

@clifton
Copy link

clifton commented Jan 6, 2012

+1 on this

none of my plugins seem to have completion working either. completion will always look for filenames

@cpojer
Copy link
Author

cpojer commented Jan 12, 2012

So anyone knows what the problem is? :)

@cpojer
Copy link
Author

cpojer commented Jan 16, 2012

I added source /usr/local/Cellar/git/1.7.8.3/etc/bash_completion.d to my .zshrc and disabled alias git="hub" and it is working for now. Should work out of the box though.

@eproxus
Copy link
Contributor

eproxus commented Jan 23, 2012

Experiencing the same thing under Ubuntu 11.10. Using the git and github plugins (the latter which aliases hub to git).

@caged
Copy link

caged commented Feb 2, 2012

Can confirm this also happens on OSX Lion when hub is aliased to git. After removing the alias, completion worked. I'm not sure which project a fix belongs in.

@cj
Copy link

cj commented Feb 19, 2012

I can confirm alias git=hub is the issue

@cj
Copy link

cj commented Feb 19, 2012

Using function git(){hub $@} instead works :D

@cpojer
Copy link
Author

cpojer commented Feb 19, 2012

that is really slow though.

@jmacdonald
Copy link
Contributor

I'm actually not getting any completion whatsoever, so I have to manually type the filenames.

Running Debian Squeeze.

@clifton
Copy link

clifton commented Mar 1, 2012

Newer version of hub installs the following:

$ which git
git () {
    if ! (( $+_has_working_hub  ))
    then
        hub --version &> /dev/null
        _has_working_hub=$(($? == 0)) 
    fi
    if (( $_has_working_hub ))
    then
        hub "$@"
    else
        command git "$@"
    fi
}

I can definitely confirm that it is very slow when doing completion.

@matschaffer
Copy link
Contributor

Since it took me a mental leap, I'll mention. Removing the alias then running 'hub' for commands like 'hub remote add' and 'hub fork' works too. Not as sexy, but it works and keeps regular git commands fast.

@robsonpeixoto
Copy link

+1

zsh --version
zsh 5.0.2 (x86_64-apple-darwin12.2.0)

@deiga
Copy link
Contributor

deiga commented Oct 13, 2013

@cj's workaround works for me and isn't slow at all.

@apanzerj
Copy link

Yeah:

$ unalias git

is the shit. My life, workflow, and sanity are now restored.

@maksimr
Copy link

maksimr commented Feb 16, 2014

github plugin doesn't work and
@cj's workaround doesn't work :(

hub --version
git version 1.8.0
hub version 1.11.2-g1c5d3bf

zsh --version
zsh 5.0.2 (x86_64-unknown-linux-gnu)

@bitoiu
Copy link

bitoiu commented Aug 3, 2015

Same issue:

zsh 5.0.5 (x86_64-apple-darwin14.0)

@rockshandy
Copy link

I have been having similar issues very recently as @bitoiu after an update (same version string).

@mcornella
Copy link
Member

Try #4444, there is a conflict with current git-extras completion. If you disable the git-extras plugin and it works, that's the problem.

@rockshandy
Copy link

That fixed it for me (actually just updated today)! Thanks.

@fiznool
Copy link

fiznool commented Dec 9, 2015

I've just experienced the same issue, using the git and github plugins (no git-extras).

My fix is to add this at the bottom of my .zshrc:

# Fix hub alias
unalias git
function git() { hub $@; }

@anrao91
Copy link

anrao91 commented Feb 3, 2016

My fix for this issue -
1)Add this line in the ~/.zshrc file.
2)source /git-completion.bash #Provided you have the git-completion.bash file saved and has contents
3)Then execute -
$
/.zshrc
4)$ZSH

@NicoSa
Copy link

NicoSa commented Aug 19, 2016

@fiznool

# Fix hub alias unalias git function git() { hub $@; }

This did it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests