Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to download and install git client for window using Powershell

Tags:

git

powershell

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.

Thanks in advance !

like image 693
Priya Rani Avatar asked Oct 13 '17 13:10

Priya Rani


People also ask

Can you install git on PowerShell?

PowerShell GalleryIf you have at least PowerShell 5 or PowerShell 4 with PackageManagement installed, you can use the package manager to install posh-git for you. More information about PowerShell Gallery: https://docs.microsoft.com/en-us/powershell/scripting/gallery/overview.

How do I download git from Windows command line?

To install Git, navigate to your command prompt shell and run the following command: sudo dnf install git-all . Once the command output has completed, you can verify the installation by typing: git version .


1 Answers

You can script installation of Git using chocolatey.

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

  1. First you must install chocolatey, but that can be done on the command line.
  2. Then the command is:

choco install -y git

like image 70
Klas Mellbourn Avatar answered Oct 02 '22 19:10

Klas Mellbourn