Home » Source Code Management ( SCM ) » Git » How to update Git to Latest Version in Linux ?

How to update Git to Latest Version in Linux ?

In old versions of Git “–initial-branch” is not supported, but some of the most online git platforms have started using this when user tries to push the code to first time in those repositories. Hence if your git version doesn’t support this options, we need to update the git.

Below steps helps to upgreade your git version,

First check what is your git version. As we can see, ours before upgrade version is “2.17.1”

$ git version
git version 2.17.1

Now, use below commands to upgrade the git version,

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

Now, lets check the version,

$ git version
git version 2.36.0

That’s it.. as you can see our git version is upgraded from 2.17.1 to 2.36.0 which is latest git version.

Subscribe our Rurban Life YouTube Channel.. "Rural Life, Urban LifeStyle"

Leave a Comment