如何使用Powershell为窗口下载并安装git客户端 [英] how to download and install git client for window using Powershell

查看:414
本文介绍了如何使用Powershell为窗口下载并安装git客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须编写自动化的powershell脚本来从gihtub克隆存储库,但我需要使用命令行安装git.请让我知道如何在不执行任何手动工作的情况下使用命令行在窗口中下载并安装git.

I have to write automated powershell script for cloning repository from gihtub but I need to install git using command line.Could you please let me know how can I download and install git on window using command line without doing any manual work.

提前谢谢!

推荐答案

您可以使用 chocolatey 脚本化Git的安装.

You can script installation of Git using chocolatey.

该软件包的文档记录在 https://chocolatey.org/packages/git

The package is documented at https://chocolatey.org/packages/git

  1. 首先,您必须安装Chocolatey,但这可以在命令行上完成.
  2. 然后命令是:

choco install -y git

choco install -y git

这篇关于如何使用Powershell为窗口下载并安装git客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆