How do I enable industry hints in Mac OS git?

On windows, when I use git bash and, for example, want to check out for some branch, the "Enter" tab shows me all branches or fills in the branch name if I wrote part of it. On my Mac OS, when I use git from my terminal, these features are disabled. Is there a way to enable them and how?

+3


source to share


2 answers


You need to install git -autocomplete , which can be obtained with homebrew :

  • Install Git and bash -completion: brew install Git bash -completion (Note: if this install fails with a 404 error and you already have Git installed just uninstall the Git part of this brew install)

  • Add bash -completion to your .bash_profile

    :



if [ -f `brew --prefix`/etc/bash_completion ]; then
    . `brew --prefix`/etc/bash_completion
fi

      

+2


source


Note: the same git completion just got more with Git 2.11 (Q4 2016)

See commit 49416ad (24 Aug 2016) by Chris Packham ( cpackham

)
.
(merge Junio ​​C Hamano - gitster

-
in commit a229a30 , October 10, 2016)



Command line completion script (c contrib/

) learned to fill in " git cmd ^mas<HT>

" to terminate the negative end of a link before " git cmd ^master

".

0


source







All Articles