使用用户名和密码克隆Git?

时间:2015-09-01 15:53:52

标签: c# git command-line command

我有一个打开应用程序git-cmd的批处理文件。在尝试克隆git存储库时,我得到提示在git-cmd上输入密码。我想从批处理文件中完成所有操作。是否有批处理文件中的命令会自动输入密码到gmd-cmd而不是windows cmd?

这是我在git-cmd上的git连接:git clone username@git.hostname.com/file.git

1 个答案:

答案 0 :(得分:-1)

如果您使用https来克隆存储库,则可以将您的用户名和密码放在URL中,如下所示:

git clone https://username:password@git.hostname.com/file.git

但是,当您公开密码时,这是一个安全问题,所以要小心。

Check also this topic to get more detailed answers