Git autocomplete does not request branch names

I tried everything that was mentioned in this , still when I press the key tabfor the command twice git checkoutI get only the following sentences

FETCH_HEAD HEAD ORIG_HEAD

whereas I expect the names of the branches.

Any other suggestion to make this work?

I'm on ubuutu 14.04

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.5 LTS
Release:    14.04
Codename:   trusty

UPDATE

global gitconfig file

[user]
        email = abc@zxc.com
        name = Abc Zxc
[credential]
        helper = cache --timeout=3600
[filter "lfs"]
        process = git-lfs filter-process
        required = true
        clean = git-lfs clean -- %f
        smudge = git-lfs smudge -- %f
[diff]
        tool = meld
[merge]
        tool = meld
[difftool]
        prompt = false

git version

kishor@kishor-ThinkCentre-E73:~$ git version
git version 1.9.1

bash components

# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.  

Team exit

git --git-dir=".git" for-each-ref --shell --format="%(refname:short)" refs/tags refs/heads refs/remotes

'160117_whole_flow_demo'
'170109_aws_mgmt_plane'
'170123_django_angular_lib'
'170124_authentication'
'170125_merging_html'
'170206_code_integration'
'170208_ng_code_snippets'
'170214_user_mapping_and_dropdown'
... and so on

PS I ran into the same problem in all other repositories.

+4
source share
1 answer

I may be wrong, but I think you are trying to use an too old version of git compared to your version of git-complete.

You can try running:

git for-each-ref --format="(refname:strip=2)" refs/heads/*

, , , , ( - fatal: unknown refname: format strip=2).

git, git -, git. , ( git github).

+1

Source: https://habr.com/ru/post/1693299/


All Articles