How to Install Hugo in Git Bash on Windows
Let’s see how we can quickly install Hugo in Git Bash on a Windows machine.
We will follow the advanced the installation that involves installing the Hugo source code with go
and building the binaries ourselves.
1. Install Golang
If we already have Golang installed, we can skip this step.
Otherwise, let’s start by installing Golang.
- Go to the official Golang downloads page
- Download by selecting
Microsoft Windows
underFeatured downloads
- Run the executable and complete the
Golang Setup Wizard
2. Install Git Bash
If we already have git and Git Bash installed, we can skip this step.
Otherwise, let’s install Git Bash.
- Go to the Git Downloads page
- Download the
Windows
executable - Run the executable and complete the
Git Setup
- On the
Select Components
page, ensure the optionGit Bash Here
is selected
3. Setup go
local environment
Let’s open up the Git Bash terminal and setup our go
local environment.
cd ~/
mkdir go && cd go
mkdir bin
mkdir pkg
mkdir src && cd src
mkdir github.com
If easier, feel free to copy all this code at once using the copy button in the top right hand corner of the code block.
4. Install Hugo
We can now install Hugo into the ~/go/src/github.com
directory using go install
.
cd ~/go/src/github.com/
mkdir gohugoio && cd gohugoio
git clone https://github.com/gohugoio/hugo.git
cd hugo
go install
Let’s confirm our Hugo installation in the terminal.
hugo version
Git Bash should now recognize the hugo
command.