Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I setup auto-complete for git on Windows via cmd.exe?

I've recently learned that on linux, git can be setup to autocomplete commands: If you type

git br<TAB>

Then it will complete it to git branch.

Can the same auto-completion be set up on Windows?

Update - I'm usually working with git via cmd.exe (I added git to my path). This question is about adding auto-completion to git on cmd, if that's possible.

like image 323
ripper234 Avatar asked Jun 24 '11 07:06

ripper234


People also ask

How do I use AutoComplete in CMD?

Using autocomplete is as simple as pressing the [TAB] and the active command line options will fill-in. If more than one option is available, you can hit [TAB] twice to display all possible choices and continue typing until there is only one matching choice left.

Can you use Git in Windows CMD?

All you have to do is load Command Prompt (Load the Start menu, then click "Run", type cmd and hit enter), then you can use Git commands as normal.

How do I run Git from CMD?

To install Git, run the following command: sudo apt-get install git-all . Once the command output has completed, you can verify the installation by typing: git version .


2 Answers

Installing Clink seems to make this work by magic, verified in cmd, Console2, and ConEmu.

http://mridgers.github.io/clink/

UPDATE: To get ConEmu and clink to work properly with the more recent versions, it was necessary to install clink into the ConEmu folder. See https://github.com/mridgers/clink/issues/339 and https://github.com/Maximus5/ConEmu/issues/270 for more info.

like image 87
jordanpg Avatar answered Oct 12 '22 04:10

jordanpg


You have to use some form of bash to get it to work, either git bash that comes with msysgit or some other bash (which you need to setup to use the autocompletion used in git bash). With cmd.exe you will have no luck.

Look at this as a sign for you to leave old rusty cmd.exe behind. Enter the light of bash! : )

like image 44
ralphtheninja Avatar answered Oct 12 '22 04:10

ralphtheninja