It's like apt-get in Linux, you can install using the command line. Run Command Prompt as Administrator and type choco install git and you'll be able to install git devoted to the command line.
This short tutorial shows how to add the Git Bash shell that is part of Git for Windows to the Windows Terminal, make it the default shell, add it's color profile and add a “Windows Terminal Here” entry to the Windows Explorer context menu…
At its core, Git is a set of command line utility programs that are designed to execute on a Unix style command-line environment. Modern operating systems like Linux and macOS both include built-in Unix command line terminals.
Launch Git Bash console by clicking on the Start button, type git, and click on Git Bash. 2. Run the below git config command to add your name ( YourName ) as your git username ( user.name ). The git config command administers configuration variables that control how Git looks and operates.
I had the same issue and resolved it by adding the /bin
directory location to the PATH Environment Variable.
Search for the file location where Git was installed, mine is C:\Users\(My UserName)\AppData\Local\GitHub
. It may also be C:\Program Files (x86)\Git
Once you have the location of Git you should see a /bin
sub-folder. It may be in a PortableGit folder (mine is
PortableGit_015aa71ef18c047ce8509ffb2f9e4bb0e3e73f13
). Copy this path.
Go to Control Panel > System > System Protection > Advanced > Environment Variables
Choose PATH, click edit and paste the bin path there. If there are already any values in your PATH paste your Git path at the end separated with a semi-colon.
Now you can access Git command from CMD.
As @birryree said, add msysgit's binary to your PATH, or use Git Bash (installed with msysgit as far as I remember) which is better than Windows' console and similar to the Unix one.
These instructions worked for a Windows 8 with a msysgit/TortoiseGit installation, but should be applicable for other types of git installations on Windows.
;C:\msysgit\bin\;C:\msysgit\mingw\bin\
In windows 8.1, setting the PATH Environment Variable to Git's bin
directory didn't work for me. Instead, I had to use the cmd
directory C:\Program Files (x86)\Git\cmd
.
Credit to @VonC in this question
For me, I'm using Windows 10, @andrew-marshall's instructions worked (Thanks!) except that git.exe
was within a cmd
directory within PortableGit...
, not bin
, so I had to put \cmd
on the end of the path I added to PATH
. Thought I would post this here in case anyone else hits the same issue. You can tell it works once git
in a new Command Prompt window returns command usage info and not an error.
In the latest version (v2.19 for Windows when I'm writing), if you choose the option "Use git in Windows command prompt" (or sth similar, please read the options carefully when you install git), you should be able to use git commands in windows command prompt or windows powershell without any additional setting. Just remember to restart the command line tool after you install git.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With