0

I need to create a .cmd file that pushes my repository to remote. However, .cmd files are open in standard command line and if I run "git push" in it, I guess standard HTTP authentication is used - I'm not asked for passphrase for my ssh key file and the authentication of course fails. Pushing works fine in Git shell (Powershell configured for git from "Github for Windows"), however, how can I create clickable shortcut in Windows which runs a command in this shell? I tried

C:\Users\Richard\AppData\Local\GitHub\GitHub.appref-ms --open-shell "push.cmd"

which did not work.

Also, I tried to run the .cmd file in normal shell adding

@setlocal
@set PLINK_PROTOCOL=ssh
git push

as advised here: Running a batch file in git shell but it made no difference - no query for my ssh key, authentication fails.

Can you help me make one of the two solutions working? Thanks.

Community
  • 1
  • 1
amik
  • 5,613
  • 3
  • 37
  • 62
  • Try adding a cd command to your second option maybe, to make sure the command is run in the root of the working copy you want to push? That way you can have the .bat or .cmd file on your desktop and it should still work. – orbrey Oct 01 '14 at 13:38
  • Well, the script is launched from the path of the repo, also my git is on system PATH, so that is not the problem... – amik Oct 01 '14 at 14:04

0 Answers0