Git is a free and open-source distributed version control management system. It lets multiple developers work and collaborate collectively while working on writing the source code during software development. It helps them track changes made to the source code over time.
This popular VCS maintains the change history/revisions with the help of commit messages. It is available for Windows, Linux, and Mac operating systems.
Keeping Git up to date is crucial since every update brings new features, some fixed bugs, improvements, and a lot more.
So, I have curated an article to help you learn how to update Git on the Windows operating system. To proceed, you should first be aware of the current version you are using. So, let us first discuss how to check the current Git version.
How to Check the Git Version on Windows?
Here are the following commands you can use to check your Git version, depending upon the setup, whether you have done using Git bash or command prompt.
git --version
Or
git -v
Let us try the above commands:
As per the above demonstration, we can see that both of the commands return the current version of Git.
Now, let us check the latest version of Git available. We can find it on the official download page , as shown in the below screenshot.
As per the latest source release, we know that our git needs an upgrade. There are two ways to upgrade git:
- Uninstall the current Git and download the latest version as per the Git installation guide . This applies to Git 2.14.1 version or older.
- Update Git using the update-git-for-windows command.
In this blog, we will go through the steps to upgrade the already installed Git.
How to Upgrade Git on Windows?
Use the below command to upgrade the current Git version if it is between 2.14.2 to 2.16.1.
git update
For 2.16.2 or later versions, use the below command to update Git.
git update-git-for-windows
As per our Git version, we need to run the “ git update-git-for-windows ” command.
Let us run the command and see how it proceeds step by step.
Step 1
Once you enter the command, it will tell you if any newer version is available for upgrade. Also, it will ask if you want to download it as you can see in the above screenshot.
Step 2
Press the ‘ y’ key to proceed. It will start the download process and will ask you for administrative permissions once the download is complete.
Step 3
Allow the permissions to seamlessly upgrade Git.
Step 4
After a successful upgrade, your git bash window will close on its automatically. To check whether Git is upgraded or not, open the git bash and check the git version as shown below.
The previous Git version was 2.38.1, and now the current version is 2.39.0.
Conclusion
So, updating Git is pretty simple. If your current version is 2.14.1 or older, uninstall Git and install it again to use the latest version. However, if the version is between 2.14.2 to 2.16.1, use the git update command. For all the above versions, use the update-git-for-windows command.
Happy learning!
People are also reading
Leave a Comment on this Post