Sharing Git credentials between Windows and WSL

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

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…


This content originally appeared on DEV Community and was authored by Camilo Martinez

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.

Source

That’s All Folks!
Happy Coding 🖖

beer


This content originally appeared on DEV Community and was authored by Camilo Martinez


Print Share Comment Cite Upload Translate Updates
APA

Camilo Martinez | Sciencx (2023-03-07T00:59:07+00:00) Sharing Git credentials between Windows and WSL. Retrieved from https://www.scien.cx/2023/03/07/sharing-git-credentials-between-windows-and-wsl/

MLA
" » Sharing Git credentials between Windows and WSL." Camilo Martinez | Sciencx - Tuesday March 7, 2023, https://www.scien.cx/2023/03/07/sharing-git-credentials-between-windows-and-wsl/
HARVARD
Camilo Martinez | Sciencx Tuesday March 7, 2023 » Sharing Git credentials between Windows and WSL., viewed ,<https://www.scien.cx/2023/03/07/sharing-git-credentials-between-windows-and-wsl/>
VANCOUVER
Camilo Martinez | Sciencx - » Sharing Git credentials between Windows and WSL. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/03/07/sharing-git-credentials-between-windows-and-wsl/
CHICAGO
" » Sharing Git credentials between Windows and WSL." Camilo Martinez | Sciencx - Accessed . https://www.scien.cx/2023/03/07/sharing-git-credentials-between-windows-and-wsl/
IEEE
" » Sharing Git credentials between Windows and WSL." Camilo Martinez | Sciencx [Online]. Available: https://www.scien.cx/2023/03/07/sharing-git-credentials-between-windows-and-wsl/. [Accessed: ]
rf:citation
» Sharing Git credentials between Windows and WSL | Camilo Martinez | Sciencx | https://www.scien.cx/2023/03/07/sharing-git-credentials-between-windows-and-wsl/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.