0

BACKGROUND: By default in git, I can get branch suggestions via tab-complete when using the checkout command. 'git checkout ' + TAB will give me a list of all branches. Unfortunately, this includes remote branches, which I don't want included. Fortunately, there is a well known fix: 'git checkout --no-guess ' + TAB. To avoid the extra typing, you can also set the environment variable GIT_COMPLETION_CHECKOUT_NO_GUESS=1. According to this question, this functionality has existed since git 2.13.

QUESTION: I am running git 2.7.4 on a Linux box. The '--no-guess' flag works for me but the GIT_COMPLETION_CHECKOUT_NO_GUESS=1 does not. Does anyone know why?

FOR THE RECORD: I am not looking for a work around, such as creating a git alias. I am specifically looking for why this documented functionality does not work for me. Please scope your response to the question at hand.

ANSWER: I am an idiot. As Mark pointed out in a comment, 2.13 > 2.7.4. I was reading it as 2.1.3 instead. Sorry for the trouble.

JimPri
  • 1,278
  • 8
  • 17
  • How are you setting the `GIT_COMPLETION_CHECKOUT_NO_GUESS` environment variable, and have you confirmed via `printenv` that the assignment stuck? – Tim Biegeleisen Apr 25 '18 at 13:58
  • Yes. I tested both by exporting the variable first and then by setting it inline with the git command. Both attempts resulted in tab-complete showing me remote branches – JimPri Apr 25 '18 at 13:59
  • Also, since I know someone will ask, I did double check my spelling. :) – JimPri Apr 25 '18 at 14:00
  • 1
    Uh... 2.7.4 < 2.13, so I'm not understanding the problem. Also, you've limited your question to "why does this software not match what I think the documentation says", which is not an on-topic SO question – Mark Adelsberger Apr 25 '18 at 14:07

0 Answers0