Update git in WSL2 Ubuntu

wslgit
Feb 9, 2024

Check the current version of git

 git --version
git version 2.25.1

Update git to the latest version

Ubuntu by default doesn't offer the latest version of git. Add git-core PPA to get the latest version of git. And then install the latest version of the git.

 sudo add-apt-repository ppa:git-core/ppa
 sudo apt update
 sudo apt install git

Check the updated version of git

 git --version
git version 2.43.0