On Thursday, September 19, 2013 11:20:30 PM UTC+4, John McKown wrote:
> Are you using Linux as a system and ssh as the transport? If so , then 
> perhaps you can try putting the command:
> 
> export GIT_SSH=ssh -i ${HOME}/.ssh/id_rsa
> 
> 
> 
> 
> before you do your sudo command. The "-i ${HOME}/.ssh/id_rsa" points to the 
> ssh key file to use. Because you use the -E switch on the sudo invocation, 
> this environment variable will be passed to the perl script and should be 
> picked up by git. 

Not that simple, unfortunately. The contents of the GIT_SSH
variable is not passed to /bin/sh, so multi-word thing is not gonna work as 
expected.
But one could wrap the whole call in a shell script
and set GIT_SSH to its full pathname.

> 
> 
> 
> Can't hurt (much) to try, I hope.
> 
> 
> 
> On Thu, Sep 19, 2013 at 12:51 PM, jon heckman <ninj...@me.com> wrote:
> 
> 
> I have a ruby script that interacts with git heavily.
> I run the entire script in sudo -E (this is needed for reasons other than git)
> 
> I can do git checkout {branch} just fine. However I get asked for the 
> root@git... password when I try to fetch.
> I tried using su to make it work but it still asks for the password (I do not 
> have to use 'su' when doing git checkout {branch}
> 
> su ENV['USER'] -c 'git fetch'
> Due to what this script is doing, not running it in sudo -E is not an option. 
> 
> 
> 
> 
> -- 
> 
> You received this message because you are subscribed to the Google Groups 
> "Git for human beings" group.
> 
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to git-users+...@googlegroups.com.
> 
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
> 
> 
> -- 
> 
> As of next week, passwords will be entered in Morse code.
> 
> Maranatha! <><
> John McKown

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to