views:

79

answers:

2

I have Ruby and GIT installed on my windows box. To run GIT commands I am utilizing the GIT Bash. To run Ruby commands I am using the command line.

I have not been successful running GIT commands from the CMD line nor can I seem to run Ruby commands from inside the GIT Bash. I would love to be able to run commands for both GIT and Ruby from the GIT Bash (ideal) or at the least from the CMD line.

What is the best way to go about this?

+6  A: 

I run git commands from the CMD session all the time.

Make sure your PATH environment variable includes the 'cmd' directory from a msysgit distro:

Path=C:\Path\To\Git\1.7.1\cmd

If not, add it in your session:

set PATH=%PATH%;C:\Path\To\Git\1.7.1\cmd

and you are done. Git and Ruby commands in your CMD shell.

The reverse (Ruby commands) is possible in a Git bash, by adding to the PATH a value like /c/path/to/Ruby/186-27/bin

alt text

VonC
VonC answer is the best one. Usage of cmd git wrapper is the safest approach to Git usage. Also, for having Ruby available in your setup, I recommend you install RubyInstaller packages.
Luis Lavena
A: 

My personal setup uses msysgit and tortoisegit. I've found that using TortoiseGit's Pageant manager for the keys lets me use everything from any command line, including powershell. The only annoyance is I have to have pageant running with the keys added, which seem to clear on every reboot. Fortunately I don't reboot often.

Karl
For my purposes I also have a Heroku gem installed that wants to run GIT commands. But until I implement the PATH solution mentioned above the Heroku command won't run from the GIT bash and the GIT commands issued by the Heroku command won't run from the command line.Seems like the Path solution should have me happily running things from the GIT bash which will be ideal.
Joseph U.