2

I have a simple batch file "clone.bat" withe the following script.

cd %1 

c:\Program Files\Git\git-cmd.exe" git clone %2 --branch %3

exit

While running the batch file I pass 4 parameters. %1 : local repo path, %2 : remote repo path, %3 : branch name , and %4 as password

I expect that when the Git command runs it should accept the %4 as password. However, it asks for password on the fly which I need to avoid.

I have set of only https authentication and not using SSH.

Srikant Sahu
  • 839
  • 1
  • 6
  • 16
  • 2
    Possible duplicate of [Is there a way to skip password typing when using https:// on GitHub?](https://stackoverflow.com/questions/5343068/is-there-a-way-to-skip-password-typing-when-using-https-on-github) – Squashman Feb 21 '18 at 21:35
  • 1
    why don't you just generate ssh keys and put the public one in the git server? Usually this is the way to automate the git operations. – npocmaka Feb 21 '18 at 21:45

1 Answers1

2

On Windows, you should not need the password as Git by default will look for it in the Windows Credential Manager:

git config credential.helper

So double-check if a password is already entered there.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250