Running git on Windows command line

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In the "CRLF behavior" thread, I found that my command line was not seeing the global settings.  This gave different results than the git-gui and naturally is a serious problem.

This note is to record my findings and will hopefully be valuable to others using Windows.

In Windows, users may be using the built-in CMD.exe, the Powershell, some other unix-like shell besides the one that comes up under "git bash here", or others.

I found that it worked correctly on a plain CMD shell with no personal preferences loaded or anything, even though the HOME environment variable does not exist.  It did not work right on my normal shell (happens to be TCC-le) which was set up about two years ago, until I added the HOME variable to my initialization script.

The plain command line adds "C:\Program Files (x86)\Git\cmd" to the PATH, and the git command resolves to git.cmd in that directory.  The latest msysgit installer set up that path globally.  Perhaps an earlier version arranged things differently?  Anyway, the TCC command line had an alias set up so git resolved to "C:\Program Files (x86)\Git\bin\git.exe", without searching.  If the situation changed with updates, it did not affect my set up there.

One of the things the git.cmd batch file does is set the HOME variable.  It also sets the code page and sets the PATH to include a couple things along the git tree.  Two years ago, I found that no such PATH was necessary once git.exe itself was launched; it apparently knows where everything else is.  One of the things it adds to PATH, %git_install_root%\mingw\bin, does not even exist!  So this script may be dated.

I'd be interested in finding out what the real story here is, if anyone knows more about it.

--John



(sorry about the footer; it is not my idea nor my choice)

TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]