Setup git in wsl2 windows


How can I setup the git in wsl? I cannot get it setup

Tried installing and setting but getting error
fatal: unable to access '

>Solution :

  1. Download WSL and Ubuntu from Windows
  2. Type sudo apt update
  3. Type

sudo touch /etc/resolv.conf

sudo chmod 777 /etc/resolv.conf

sudo printf 'nameserver\nnameserver' > /etc/resolv.conf

  1. Install git by sudo apt install git
  2. git config --global --add '*'
  3. git clone your repo repository
  4. Add your credentials by using a personal token as password is outdated
  5. git config --global credential.helper store (optional to store the credentials)

Leave a Reply Cancel reply