Tab completion for git branches showing old/outdated entries
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm on a sort of frankendebian stretch/sid (not the best idea, I know; planning on reinstalling soon).
Tab completion works for git branch names in git repo directories:
:~/project $ git checkout <TAB><TAB>
Display all 200 possibilities? (y or n)
:~/project $ git checkout private-rl_<TAB><TAB>
private-rl_1219_misspelled_locale_zhtw private-rl_1950_scheduler_offset private-rl_bootstrap_rake_tasks
private-rl_1854_ldap_filter_reset private-rl_bootstrap_rake_task
But some of the branches it shows don't exist anymore:
:~/project $ git branch
* develop
private-rl_1219_misspelled_locale_zhtw
stable
This also happens for deleted remote branches.
What's going on here? Does the git completion script keep a cache of old branches that can be flushed somehow? How can I stop these branches from accumulating in my tab-completion results?
git autocomplete
add a comment |Â
up vote
0
down vote
favorite
I'm on a sort of frankendebian stretch/sid (not the best idea, I know; planning on reinstalling soon).
Tab completion works for git branch names in git repo directories:
:~/project $ git checkout <TAB><TAB>
Display all 200 possibilities? (y or n)
:~/project $ git checkout private-rl_<TAB><TAB>
private-rl_1219_misspelled_locale_zhtw private-rl_1950_scheduler_offset private-rl_bootstrap_rake_tasks
private-rl_1854_ldap_filter_reset private-rl_bootstrap_rake_task
But some of the branches it shows don't exist anymore:
:~/project $ git branch
* develop
private-rl_1219_misspelled_locale_zhtw
stable
This also happens for deleted remote branches.
What's going on here? Does the git completion script keep a cache of old branches that can be flushed somehow? How can I stop these branches from accumulating in my tab-completion results?
git autocomplete
Are you sure they are not tags? Autocompletion takes into account tags, and many other things. See top comments on github.com/git/git/blob/master/contrib/completion/â¦
â Patrick Mevzek
May 3 at 13:24
I'm 100% sure they're not tags. I created and deleted those branches myself. Weird though â I just did$ sudo fd --hidden --no-ignore git-completion /
, and didn't get any results.
â Ryan Lue
May 3 at 14:04
Dogit branch -a
to see all branches. Remote branches may be taken into account also.
â Patrick Mevzek
May 3 at 14:09
Thanks, it was references to deleted remotes (see answer below).
â Ryan Lue
May 3 at 14:30
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm on a sort of frankendebian stretch/sid (not the best idea, I know; planning on reinstalling soon).
Tab completion works for git branch names in git repo directories:
:~/project $ git checkout <TAB><TAB>
Display all 200 possibilities? (y or n)
:~/project $ git checkout private-rl_<TAB><TAB>
private-rl_1219_misspelled_locale_zhtw private-rl_1950_scheduler_offset private-rl_bootstrap_rake_tasks
private-rl_1854_ldap_filter_reset private-rl_bootstrap_rake_task
But some of the branches it shows don't exist anymore:
:~/project $ git branch
* develop
private-rl_1219_misspelled_locale_zhtw
stable
This also happens for deleted remote branches.
What's going on here? Does the git completion script keep a cache of old branches that can be flushed somehow? How can I stop these branches from accumulating in my tab-completion results?
git autocomplete
I'm on a sort of frankendebian stretch/sid (not the best idea, I know; planning on reinstalling soon).
Tab completion works for git branch names in git repo directories:
:~/project $ git checkout <TAB><TAB>
Display all 200 possibilities? (y or n)
:~/project $ git checkout private-rl_<TAB><TAB>
private-rl_1219_misspelled_locale_zhtw private-rl_1950_scheduler_offset private-rl_bootstrap_rake_tasks
private-rl_1854_ldap_filter_reset private-rl_bootstrap_rake_task
But some of the branches it shows don't exist anymore:
:~/project $ git branch
* develop
private-rl_1219_misspelled_locale_zhtw
stable
This also happens for deleted remote branches.
What's going on here? Does the git completion script keep a cache of old branches that can be flushed somehow? How can I stop these branches from accumulating in my tab-completion results?
git autocomplete
asked May 3 at 3:28
Ryan Lue
1947
1947
Are you sure they are not tags? Autocompletion takes into account tags, and many other things. See top comments on github.com/git/git/blob/master/contrib/completion/â¦
â Patrick Mevzek
May 3 at 13:24
I'm 100% sure they're not tags. I created and deleted those branches myself. Weird though â I just did$ sudo fd --hidden --no-ignore git-completion /
, and didn't get any results.
â Ryan Lue
May 3 at 14:04
Dogit branch -a
to see all branches. Remote branches may be taken into account also.
â Patrick Mevzek
May 3 at 14:09
Thanks, it was references to deleted remotes (see answer below).
â Ryan Lue
May 3 at 14:30
add a comment |Â
Are you sure they are not tags? Autocompletion takes into account tags, and many other things. See top comments on github.com/git/git/blob/master/contrib/completion/â¦
â Patrick Mevzek
May 3 at 13:24
I'm 100% sure they're not tags. I created and deleted those branches myself. Weird though â I just did$ sudo fd --hidden --no-ignore git-completion /
, and didn't get any results.
â Ryan Lue
May 3 at 14:04
Dogit branch -a
to see all branches. Remote branches may be taken into account also.
â Patrick Mevzek
May 3 at 14:09
Thanks, it was references to deleted remotes (see answer below).
â Ryan Lue
May 3 at 14:30
Are you sure they are not tags? Autocompletion takes into account tags, and many other things. See top comments on github.com/git/git/blob/master/contrib/completion/â¦
â Patrick Mevzek
May 3 at 13:24
Are you sure they are not tags? Autocompletion takes into account tags, and many other things. See top comments on github.com/git/git/blob/master/contrib/completion/â¦
â Patrick Mevzek
May 3 at 13:24
I'm 100% sure they're not tags. I created and deleted those branches myself. Weird though â I just did
$ sudo fd --hidden --no-ignore git-completion /
, and didn't get any results.â Ryan Lue
May 3 at 14:04
I'm 100% sure they're not tags. I created and deleted those branches myself. Weird though â I just did
$ sudo fd --hidden --no-ignore git-completion /
, and didn't get any results.â Ryan Lue
May 3 at 14:04
Do
git branch -a
to see all branches. Remote branches may be taken into account also.â Patrick Mevzek
May 3 at 14:09
Do
git branch -a
to see all branches. Remote branches may be taken into account also.â Patrick Mevzek
May 3 at 14:09
Thanks, it was references to deleted remotes (see answer below).
â Ryan Lue
May 3 at 14:30
Thanks, it was references to deleted remotes (see answer below).
â Ryan Lue
May 3 at 14:30
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
I figured it out, thanks to some gentle prodding from @PatrickMevzek:
The branches I was seeing were actually references to remote branches that had already been deleted. To quote the top answer from the SO thread linked above,
$ git remote prune origin
fixed it for me.
add a comment |Â
up vote
-1
down vote
git(1) comes with contributed files in git/contrib/completion/
in the source. The script for your shell handles completions.
I appreciate the sentiment, but the script as linked by @PatrickMevzek above is already over 3,000 lines long. If I had all day to read throughgit-completion.bash
, well, I'd probably take my dogs for a hike instead anyway.
â Ryan Lue
May 3 at 14:07
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
I figured it out, thanks to some gentle prodding from @PatrickMevzek:
The branches I was seeing were actually references to remote branches that had already been deleted. To quote the top answer from the SO thread linked above,
$ git remote prune origin
fixed it for me.
add a comment |Â
up vote
2
down vote
accepted
I figured it out, thanks to some gentle prodding from @PatrickMevzek:
The branches I was seeing were actually references to remote branches that had already been deleted. To quote the top answer from the SO thread linked above,
$ git remote prune origin
fixed it for me.
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
I figured it out, thanks to some gentle prodding from @PatrickMevzek:
The branches I was seeing were actually references to remote branches that had already been deleted. To quote the top answer from the SO thread linked above,
$ git remote prune origin
fixed it for me.
I figured it out, thanks to some gentle prodding from @PatrickMevzek:
The branches I was seeing were actually references to remote branches that had already been deleted. To quote the top answer from the SO thread linked above,
$ git remote prune origin
fixed it for me.
answered May 3 at 14:29
Ryan Lue
1947
1947
add a comment |Â
add a comment |Â
up vote
-1
down vote
git(1) comes with contributed files in git/contrib/completion/
in the source. The script for your shell handles completions.
I appreciate the sentiment, but the script as linked by @PatrickMevzek above is already over 3,000 lines long. If I had all day to read throughgit-completion.bash
, well, I'd probably take my dogs for a hike instead anyway.
â Ryan Lue
May 3 at 14:07
add a comment |Â
up vote
-1
down vote
git(1) comes with contributed files in git/contrib/completion/
in the source. The script for your shell handles completions.
I appreciate the sentiment, but the script as linked by @PatrickMevzek above is already over 3,000 lines long. If I had all day to read throughgit-completion.bash
, well, I'd probably take my dogs for a hike instead anyway.
â Ryan Lue
May 3 at 14:07
add a comment |Â
up vote
-1
down vote
up vote
-1
down vote
git(1) comes with contributed files in git/contrib/completion/
in the source. The script for your shell handles completions.
git(1) comes with contributed files in git/contrib/completion/
in the source. The script for your shell handles completions.
answered May 3 at 11:32
vonbrand
13.9k22443
13.9k22443
I appreciate the sentiment, but the script as linked by @PatrickMevzek above is already over 3,000 lines long. If I had all day to read throughgit-completion.bash
, well, I'd probably take my dogs for a hike instead anyway.
â Ryan Lue
May 3 at 14:07
add a comment |Â
I appreciate the sentiment, but the script as linked by @PatrickMevzek above is already over 3,000 lines long. If I had all day to read throughgit-completion.bash
, well, I'd probably take my dogs for a hike instead anyway.
â Ryan Lue
May 3 at 14:07
I appreciate the sentiment, but the script as linked by @PatrickMevzek above is already over 3,000 lines long. If I had all day to read through
git-completion.bash
, well, I'd probably take my dogs for a hike instead anyway.â Ryan Lue
May 3 at 14:07
I appreciate the sentiment, but the script as linked by @PatrickMevzek above is already over 3,000 lines long. If I had all day to read through
git-completion.bash
, well, I'd probably take my dogs for a hike instead anyway.â Ryan Lue
May 3 at 14:07
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f441442%2ftab-completion-for-git-branches-showing-old-outdated-entries%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Are you sure they are not tags? Autocompletion takes into account tags, and many other things. See top comments on github.com/git/git/blob/master/contrib/completion/â¦
â Patrick Mevzek
May 3 at 13:24
I'm 100% sure they're not tags. I created and deleted those branches myself. Weird though â I just did
$ sudo fd --hidden --no-ignore git-completion /
, and didn't get any results.â Ryan Lue
May 3 at 14:04
Do
git branch -a
to see all branches. Remote branches may be taken into account also.â Patrick Mevzek
May 3 at 14:09
Thanks, it was references to deleted remotes (see answer below).
â Ryan Lue
May 3 at 14:30