When I use git on Windows, I basically do everything through a GUI, which works quite differently from my usual CUI workflow. Looking things up every single time is a pain, so I am putting it all together here.

Environment

Windows10 Pro

Installing Git

It is good to have pure git around, so grab it from here:

https://git-scm.com/download/win

Unlike on MacOS or Linux, the command line on Windows is awkward to use, so you are better off going with a GUI. My recommendation is a client called Fork. You can buy a license for $49, or use it as an evaluation version for free, forever.

https://git-fork.com/

SourceTree would be fine too, but the fact that it is made by Atlassian rubs me the wrong way, and I personally cannot bring myself to use it (pure prejudice).

Editing gitconfig

So you have installed Git—but where is the gitconfig? It is simply under your user directory.

C:\Users\username\

When you install Git, you get Git(GUI), Git(Bash), and Git(CMD). Of these, Bash can be used as a sort of terminal app that gives you a CUI (mingw).

git config --global -e

lets you edit it. It opens in whatever editor you configured beforehand, so set it to your editor of choice.

e.g. Sublime Text

git config --global core.editor "'C:\Program Files\Sublime Text\sublime_text.exe' -w"

Installing your GPG private key

(Feel free to skip this if you do not need it, but for the sake of git security I strongly recommend it.)

GPG is also easier to handle from a CUI, but since the Windows CUI environment (cmd prompt, powershell, and so on) is just plain awkward, we will use a GUI tool.

First, install GPG4Win. Kleopatra, which comes bundled with it, lets you generate, import, and export GPG keys.

https://www.gpg4win.org/

Once installed, open Kleopatra.

Kleopatra

I already had a gpg key in use, so I imported it. By the way, this is my gpg key.

Importing GPG keys is explained all over the place, so I will skip it here.

Once the gpg import is done, do not forget to update your gitconfig. It should end up looking like this:

[user]
        name = Your Name
        email = your@email.com
        signingkey = gpg_signing_key
[commit]
        gpgsign = true

For signingkey, copy the Key-ID from kleopatra.

Wrapping up

With that, you can use git on windows. Edit in your texteditor or IDE, then commit and push from Fork—it should all go smoothly.

So then, Happy Coding!