[英]Automate commands in git cmd?
有没有一种方法可以自动执行git-cmd中的输入而无需实际输入input命令? 假设将输入写入脚本以自动运行?
我有完全相同的情况,我使用Expect自动化了
#!/usr/bin/expect set timeout 600 log_user 0 spawn git clone http://myuser@myserver/group/repo.git tmp/repo expect "Password for 'http://myuser@myserver':" send "mypassword\r" expect eof
关键是适当设置timeout 。
timeout
我看到可以使用Windows 。
假设“ git-cmd”是Git的Windows命令外壳设置,那么您所需要做的就是编写命令脚本(或批处理文件)。 您可以在此处找到一般说明。 值得注意的是,Git bin文件夹将需要放在您的路径中。 这里描述了克隆仓库的Git命令。 正如在另一个答案中提到的,您可以编写一个程序以生成命令外壳并运行命令脚本,但这似乎很漫长。
希望能有所帮助。
[英]Running commands in CMD as administrator
[英]Running cmd commands
[英]Custom CMD Commands
[英]C# execute cmd commands
[英]Multiple CMD commands C#
[英]Execute CMD commands in C#
[英]Pass commands to a running external CMD
[英]Running cmd commands via .NET?
[英]Send multiple TELNET commands in cmd
[英]Running cmd commands with Administrator rights
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.