The govcookiecutter
project includes useful functionality such as loading secrets as environment variables, but ignoring them from
version control. However, some of this functionality is Unix-based, and not supported natively on Windows. This page
covers how to configure your Windows system to use this Unix-based functionality in its entirety.
⚠️ We have only tested Windows support with the following requirements. Your experience may differ!
- Windows 10 64-bit system; this process may work for other Windows versions
- User account with administrator privileges
- Might be able to use an account with
SeCreateSymbolicLinkPrivilege
privilege privileges (untested)
- Might be able to use an account with
- Git for Windows installed with the correct settings
- Windows release of
direnv
set up
If you do not have Git for Windows, following the fresh installs instructions. Otherwise, check the configuration options for your existing install.
- Download Git for Windows on to your machine
- In the folder containing the download, double-click on the executable
.exe
file- The file should be called
Git-<<<VERSION>>>-64-bit.exe
, where<<<VERSION>>>
is the version of Git for Windows
- The file should be called
- Go through all the installation instructions until Step 10 "Configuring extra options", and check the
Enable symbolic links
checkbox - Continue with the rest of the installation instructions, and finish the installation
- Check that symbolic links have been configured, as outlined in the next section
- Open the Run dialog box (shortcut: Win + R), and type
%PROGRAMDATA%/Git
and press the "OK" button - In the File Explorer, you should see a file called
config
. Open this in your favourite text editor, and check that thesymlinks
variable is set totrue
- If not, you will need to re-open the
config
file in your text editor with administrator privileges to change thesymlinks
value totrue
- If not, you will need to re-open the
Once complete, you can now set up direnv
Once you have set up Git for Windows, you need to download the Windows
release of direnv
locally, and set up symbolic links to the direnv
command.
Go to the direnv
releases page, and, for the latest release, download the Windows 64-bit
executable; this is usually called direnv.windows-amd64.exe
.
For maintainability, create a direnv
folder within your Git for Windows installation location, e.g.
C:\Program Files\Git\usr\bin\direnv
, and move the download there. You may need administrator privileges to do this.
Now set up the symbolic link.
- Open the Run dialog box (shortcut: Win + R)
- Type
cmd
to open the command prompt - Create a symbolic link so that entering the
direnv
command runs thedirenv.windows-amd64.exe
executable file.wheremklink direnv <<<FILEPATH TO direnv.windows-amd64.exe>>>
<<FILEPATH TO direnv.windows-amd64.exe>>>
is the filepath to thedirenv.windows-amd64.exe
executable file. Remember, if your filepath contains spaces, you will need to double quote it, for example:mklink direnv "C:\Program Files\Git\usr\bin\direnv\direnv.windows-amd64.exe"
Now you can add the direnv
hooks to Git for Windows.
- Open
git-bash
— in the Start menu this should be listed in the Git folder as "Git Bash" - Create a
.bash_profile
, and add thedirenv
hook to it by entering the following command:echo 'eval "$(direnv hook bash)"' >> ~/.bash_profile
- Restart
git-bash
by closing it, and openinggit-bash
again - Check that
direnv
has been correctly installed by enteringdirenv
:You should see a list of availabledirenv
direnv
commands printed out!
Follow these steps to get Make
installed in git-bash
:
- Go to ezwinports
- Download the
make-<<<VERSION>>>-without-guile-w32-bin.zip
file, where<<<VERSION>>>
is the version of theMake
port - Unzip the download
- Copy all the folders except
share
- Paste into the
mingw64
folder of your Git installation, for example atC:\Program Files\Git\mingw64
. Do not overwrite or replace any files, only merge in the folders - Open
git-bash
, and typemake
— you should see the following message:make: *** No targets specified and no makefile found. Stop.
To get all the make
commands in the Makefile
work, you also need to create a symbolic link to the Windows more
command:
- Open the Run dialog box (shortcut: Win + R)
- Type
cmd
to open the command prompt - Enter the following command:
mklink more C:\Windows\System32\more.com
You should now be able to run all the make
commands within the Makefile
.
Here are links to other useful instructions for getting this project running on Windows:
- Using
git-bash
in PyCharm's terminal - Setting up Anaconda for
git-bash
— note you shouldecho
into~/.bash_profile
not~/.profile