Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using user installed git (2.5) with the suggested /bin/agent.cmd does not work #609

Closed
jankatins opened this issue Aug 25, 2015 · 5 comments

Comments

@jankatins
Copy link
Contributor

The problem is that ssh-agent is not in path: the scripts expects it in path (which in my case only has C:\Program Files\Git\bin and C:\Program Files\Git\cmd -> git installed so that I can use if from cmd), but it is in C:\Program Files\Git\usr\bin

There is also a start-ssh-agent.bat in C:\Program Files\Git\cmd, which works (ok, if I call it in init.bat, it prints a few funny lines :-( -> git-for-windows/git#314).

@jankatins
Copy link
Contributor Author

probably related to #610 -> unix commands not on path

@manolenso
Copy link

two ways to fix it

mv ~/.bashrc ~/.bash_profile (.bash_profile read at start by Git 2.5)
OR
create .bash_profile file and put this code at the start to read .bashrc:

if [ -f ~/.bashrc ]
then
    . ~/.bashrc
fi

@jankatins
Copy link
Contributor Author

@manolenso I don't think this will change anything: agent.cmd does not call git to call the real ssh-agent.exe, it's launched directly in cmder.

The problem is that git 2.5 packaged the unix commands in <git>/usr/bin instead of <git>/bin, but the init.bat only adds the second to the path. So IMO one of the following should happen:

  • Add the unix tools to the path in init.bat when a git 2.5 is found (should probably happen anyway to get the unix tools)
  • call ssh-agent.exe with the full path in agent.cmd
  • simple use start-ssh-agent.bat instead of the cmder version agent.cmd

I would argue for the last one (less code duplication), but that's probably incompatible with git 1.x, so needs the git 2.5 update first (and a comment that git 2.5 is required to start the agent).

@Stanzilla
Copy link
Member

#605

@thoroc
Copy link

thoroc commented Sep 3, 2015

thanks @JanSchulz

Added the extra path to the environment and modified the init.bat to take into account the new git path. and that works. 👯

Variables as follow

λ echo %GIT%
"C:\Program Files\Git\usr\bin";"C:\Program Files\Git\cmd";"C:\Program Files\Git\bin"

λ echo %PATH%
C:\tools\cmder\bin;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;"C:\Program Files\Git\usr\bin";"C:\Program Files\Git\cmd";"C:\Program Files\Git\bin";C:\Program Files (x86)\Vim\vim74;...

On a side note, maybe it would be good to offer the user the opportunity to set custom path for the different tools or integrate with a package manager, so we can update some tools to the latest version more easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants