DEV Community

Cover image for Sharing Git credentials between Windows and WSL
Camilo Martinez
Camilo Martinez

Posted on

 

Sharing Git credentials between Windows and WSL

Download Git for Windows and choose Git Credential Manager (GCM) as credential helper on the installation steps.

gcm

If you use HTTPS to clone your repositories, you can share this with WSL so that passwords you enter are persisted on both sides.

Note that this does not apply to using SSH keys.

Just follow these steps:

  1. Configure the credential manager on Windows by running the following in a Windows command prompt or PowerShell:

     git config --global credential.helper wincred
    
  2. Configure WSL to use the same credential helper, but running the following in a WSL terminal:

     git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager-core.exe"
    

Any password you enter when working with Git on the Windows side will now be available to WSL and vice versa.


Bonus Track


That’s All Folks!
Happy Coding 🖖

beer

Sources

Top comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git