1

I have a batch file that will open a application git-cmd. When trying to clone a git repository, i'm getting prompt to enter password on the git-cmd. I want to do it all from the batch file. Is there a command from the batch file that will enter the password automatically to the gmd-cmd and not the windows cmd?

Here's my git connection on git-cmd: git clone [email protected]/file.git

  • you can use git clone ssh://${gitUser}@${gitIP}:${gitPort}/${gitDir} ./ with a RSA key to prevent password check, i ve done a script for my bro to manage git trought bash, maybe it can help you https://github.com/Fro99666/BASH_froggLinuxGitManager and for the RSA key check here : https://github.com/Fro99666/BASH_froggLinuxInstallRsaKey – Froggiz Sep 01 '15 at 16:02
  • @Froggiz i'm still getting prompt with password. – TheNewGuyOnTheRock Sep 01 '15 at 16:08
  • if you use RSA key you should not have a prompt, i am using it without, maybe you need more info about rsa/public key ? – Froggiz Sep 01 '15 at 16:15
  • is there a way without rsa/public key? – TheNewGuyOnTheRock Sep 01 '15 at 16:17

1 Answers1

1

If you are using https to clone your repository you can put your username and password in URL like this:

git clone https://username:[email protected]/file.git

However this is a security issue as you expose your password, so be careful.

Check also this topic to get more detailed answers

Community
  • 1
  • 1
Kacper Dziubek
  • 1,513
  • 1
  • 11
  • 16