Как узнать версию git на windows

I’m trying to follow some tutorials to learn how to use Git but some of the instructions are for specific versions.

Is there a command that I can use find out what version I have installed?

cloudfeet's user avatar

cloudfeet

12.3k1 gold badge56 silver badges58 bronze badges

asked Dec 12, 2011 at 14:37

Paul Sheldrake's user avatar

Paul SheldrakePaul Sheldrake

7,52510 gold badges39 silver badges50 bronze badges

0

$ git --version
git version 1.7.3.4

git help and man git both hint at the available arguments you can pass to the command-line tool

answered Dec 12, 2011 at 14:39

Gareth's user avatar

1

If you’re using the command-line tools, running git --version should give you the version number.

answered Dec 12, 2011 at 14:39

Gnat's user avatar

GnatGnat

2,8611 gold badge21 silver badges30 bronze badges

In a command prompt:

$ git --version

answered Dec 12, 2011 at 14:40

rachel's user avatar

rachelrachel

1913 bronze badges

Or even just

git version

Results in something like

git version 1.8.3.msysgit.0

answered Jul 21, 2013 at 9:05

nawfal's user avatar

nawfalnawfal

70.3k56 gold badges326 silver badges369 bronze badges

From Gareth’s answer:

git help and man git both hint at the available arguments you can pass to the command-line tool

Actually, the git version command finally gets an official help page with Git 2.34 (Q4 2021):

See commit b6d8887 (14 Sep 2021) by Matthias Aßhauer (rimrul).
(Merged by Junio C Hamano — gitster — in commit 188da7d, 23 Sep 2021)

documentation: add documentation for ‘git version’

Signed-off-by: Matthias Aßhauer

While ‘git version(man) is probably the least complex git command, it is a non-experimental user-facing builtin command.
As such it should have a help page.

Both git help(man) and git version can be called as options (--help/--version) that internally get converted to the corresponding command.
Add a small paragraph to Documentation/git.txt describing how these two options interact with each other and link to this help page for the sub-options that --version can take.
Well, currently there is only one sub-option, but that could potentially increase in future versions of Git.

git version now includes in its man page:

git-version(1)

NAME

git-version — Display version information about Git

SYNOPSIS

git version [--build-options]

DESCRIPTION

With no options given, the version of ‘git’ is printed on the standard output.

Note that git --version is identical to git version because the
former is internally converted into the latter.

OPTIONS

--build-options

Include additional information about how git was built for diagnostic
purposes.

git now includes in its man page:

This option is internally converted to git version ... and accepts
the same options as the git version command.
If --help is also given, it takes precedence over --version.

answered Oct 10, 2021 at 13:45

VonC's user avatar

VonCVonC

1.3m530 gold badges4436 silver badges5275 bronze badges

Since git 2.37.0 you can also simply use git -v

answered Aug 29, 2022 at 18:47

idanakav's user avatar

idanakavidanakav

1,4661 gold badge13 silver badges23 bronze badges

which git &> /dev/null || { echo >&2 "I require git but it's not installed.  Aborting."; exit 1; }
echo "Git is installed."

That will echo «Git is installed» if it is, otherwise, it’ll echo an error message. You can use this for scripts that use git

It’s also customizable, so you can change «which git» to «which java» or something, and change the error message.

answered Sep 13, 2016 at 18:08

Lee Ikard's user avatar

1

NAME

git-version — Display version information about Git

SYNOPSIS

git version [--build-options]

DESCRIPTION

With no options given, the version of git is printed on the standard output.

Note that git --version is identical to git version because the
former is internally converted into the latter.

OPTIONS

—build-options

Include additional information about how git was built for diagnostic
purposes.

I’m trying to follow some tutorials to learn how to use Git but some of the instructions are for specific versions.

Is there a command that I can use find out what version I have installed?

cloudfeet's user avatar

cloudfeet

12.3k1 gold badge56 silver badges58 bronze badges

asked Dec 12, 2011 at 14:37

Paul Sheldrake's user avatar

Paul SheldrakePaul Sheldrake

7,52510 gold badges39 silver badges50 bronze badges

0

$ git --version
git version 1.7.3.4

git help and man git both hint at the available arguments you can pass to the command-line tool

answered Dec 12, 2011 at 14:39

Gareth's user avatar

1

If you’re using the command-line tools, running git --version should give you the version number.

answered Dec 12, 2011 at 14:39

Gnat's user avatar

GnatGnat

2,8611 gold badge21 silver badges30 bronze badges

In a command prompt:

$ git --version

answered Dec 12, 2011 at 14:40

rachel's user avatar

rachelrachel

1913 bronze badges

Or even just

git version

Results in something like

git version 1.8.3.msysgit.0

answered Jul 21, 2013 at 9:05

nawfal's user avatar

nawfalnawfal

70.3k56 gold badges326 silver badges369 bronze badges

From Gareth’s answer:

git help and man git both hint at the available arguments you can pass to the command-line tool

Actually, the git version command finally gets an official help page with Git 2.34 (Q4 2021):

See commit b6d8887 (14 Sep 2021) by Matthias Aßhauer (rimrul).
(Merged by Junio C Hamano — gitster — in commit 188da7d, 23 Sep 2021)

documentation: add documentation for ‘git version’

Signed-off-by: Matthias Aßhauer

While ‘git version(man) is probably the least complex git command, it is a non-experimental user-facing builtin command.
As such it should have a help page.

Both git help(man) and git version can be called as options (--help/--version) that internally get converted to the corresponding command.
Add a small paragraph to Documentation/git.txt describing how these two options interact with each other and link to this help page for the sub-options that --version can take.
Well, currently there is only one sub-option, but that could potentially increase in future versions of Git.

git version now includes in its man page:

git-version(1)

NAME

git-version — Display version information about Git

SYNOPSIS

git version [--build-options]

DESCRIPTION

With no options given, the version of ‘git’ is printed on the standard output.

Note that git --version is identical to git version because the
former is internally converted into the latter.

OPTIONS

--build-options

Include additional information about how git was built for diagnostic
purposes.

git now includes in its man page:

This option is internally converted to git version ... and accepts
the same options as the git version command.
If --help is also given, it takes precedence over --version.

answered Oct 10, 2021 at 13:45

VonC's user avatar

VonCVonC

1.3m530 gold badges4436 silver badges5275 bronze badges

Since git 2.37.0 you can also simply use git -v

answered Aug 29, 2022 at 18:47

idanakav's user avatar

idanakavidanakav

1,4661 gold badge13 silver badges23 bronze badges

which git &> /dev/null || { echo >&2 "I require git but it's not installed.  Aborting."; exit 1; }
echo "Git is installed."

That will echo «Git is installed» if it is, otherwise, it’ll echo an error message. You can use this for scripts that use git

It’s also customizable, so you can change «which git» to «which java» or something, and change the error message.

answered Sep 13, 2016 at 18:08

Lee Ikard's user avatar

1

Git is a free and open-source distributed version control system that handles projects of all sizes quickly and efficiently. It outperforms SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.

Git is a distributed version control system that tracks changes in any collection of computer files. 

It is typically used to coordinate work among programmers developing source code collaboratively during software development. Its objectives include data integrity, speed, and support for distributed, non-linear processes (thousands of parallel branches running on different systems). 

Git runs smoothly on a variety of operating systems. It enables each developer’s working copy of the code to serve as a repository for all updates rather than using a single repository with the program’s complete version history, as was the case with once-popular version control schemes like CVS or Subversion (also known as SVN),

You rarely think about upgrading Git after installing it on your PC. This is because it never informs you when new updates are available. However, updating your software and apps is critical and should be done as soon as new updates become available. It helps improve performance, fix bugs, and add new features.

To check your Git version, follow these steps:

Step 1: Launch your terminal (Linux, macOS), command prompt (Windows), or any preferred command-line interface.

Step 2: Type git –version and hit Enter to run the command.

This command will display your current Git version when you input and run it.

How to Update Git

Once you’ve determined your current Git version, the next step is to verify it’s the latest version. However, you do not need to google the latest version to verify. The update procedure will notify you if you already have the most recent version installed.

These are the steps involved in updating Git on all three operating systems:

Linux

On Linux, you do not have to update Git independently from the other software. When you update Linux, Git and other installed packages are immediately updated. 

Windows

Updating Git on Windows is dependent on your current version of Windows. If you’re using Git version 2.14.1 or older, you must uninstall Git and re-download it. To download Git, go to the official Git website and download the most recent version to your system.

git website

If you’re running any Git version from 2.14.2 to 2.16.1, run the following command on your command prompt:

git update

For version 2.16.1 and later, run the command:

git update-git-for-windows

macOS

If you installed Git on your Mac using Homebrew, input the brew command:

brew upgrade git

You will receive a warning if you already have the latest version of git installed.

Although macOS includes a version of Git, updates are not released regularly. As such, if you want the most recent version, you should use Homebrew. It’s free and open-source, and it simplifies the entire procedure. Furthermore, it releases updates more frequently.

Alternatively, you can download and run the most recent installer from the official Git website to update your Git version.

Conclusion

Whether you operate Git on Linux, macOS, or Windows, you should make it a must to update it regularly. Ensure you update your software constantly to enjoy the latest features. This article explains exactly how to check your Git version and also how to update your Git version on Linux, mac, and Windows operating systems.


Posted:
07 Jun, 21


Updated:
30 Mar, 22



by Antoniy Yushkevych



6 Min

How to check Git version [Current Git Version Command]

List of content you will read in this article:

Git is an open and free source distributed version control framework that can accommodate small to very big projects with ease, it is simple to understand and use, with a small footprint and lightning-quick efficiency. With features like cheap local splitting, easy staging areas, and various workflows, it outperforms SCM resources like Subversion, CVS, Perforce, and ClearCase. with the help of this blog post you will find relevant information on how to check Git version?

it is perhaps the most popular modern version control system that is being used today. it is an established, regularly managed open source project created by Linus Torvalds, the Linux operating system kernel developer in 2005. it is used for version control in a staggering amount of both commercial and open-source software programs. Git-experienced professionals are plentiful in the pool of potential software development expertise, and it runs smoothly on a variety of operating systems and IDEs. it is also a presentation of a distributed version control system (DVCS), distributed architecture (hence Distributed Version Control System). It allows each developer’s working copy of the code to serve as a repository for all updates rather than using a single repository with the entire version history of the program, which is the case for once-popular version control schemes like CVS or Subversion (also known as SVN),

it was built with efficiency, security, and versatility in mind, in addition to being distributed.

What Can Git Do?

Git supports and promotes various local branches that are completely independent of one another that takes a few seconds to create, merge, and delete those production lines.

As a result, you can do stuff like:

  • Context Switching with Little Friction: To test an idea, create a branch, commit a couple of times, turn back to where you branched from, add a patch, switch back to where you’re testing, and integrate it in.
  • Code Lines Based on Roles: Create a branch that only includes whatever heads to manufacturing, a branch that you combine development into it for research, and a few smaller branches for day-to-day operation.
  • Workflow-Based on Features: Develops a new branch for any new development to transition among them easily and uninstall every branch until the feature is integrated into the mainline.
  • Research and Testing with Disposables: Create a branch to experiment in, remember it’s not going to work, and simply uninstall it, quitting the tasks (even when you’ve forced many branches in the meantime).

You don’t have to push any of the branches to a remote repository, for example. You have the option of sharing either one, a couple, or all of your divisions. It allows people to experiment with new ideas without thinking about how and where they can integrate them or share them with others.

Part of this is accomplished with other systems, but the job is often more complex and error-prone. Git renders this method extremely simple, and once learned, it transforms the way most developers function.

How to Check Current Git Version?

Execute this basic Linux command below in a terminal (Linux, macOS), or the command prompt will show you the new Git version (Windows).

git --version 

git version 2.7.4

If you don’t see a compatible version of Git, then upgrade Git or install it from scratch, as described below.

How to install or update Git on Linux?

Install Git for your package manager. For example, using Sudo apt-get install git on Ubuntu 13.10. Install the new secure Git version from the Git website as an alternative to uploading.

  • Users might well have to use a separate module repository if you’re using a certain Linux distribution to get the new stable edition of Git.
  • You may have to update Git from the source if you need the most recent upgrade.

after executing the above-given guide you can check Git version, and you will find that you have the latest/current Git version. if you want to host your website on a Linux server then you can choose us, we will give you full support.

If the planned Git version is still not visible, add the Git install position to your path. In a text editor, open your /.profile file and add this section, where path/to/git> is the Git install location:

export PATH=$PATH:<path/to/git>

The git command is used to locate Git’s installation directory.

How to install or update Git On macOS?

The Git website has the most recent stable Git release.

To run the installer, double-click the. pkg icon after you’ve downloaded the.dmg package. This would replace the old edition of Git with the current version:

Alternatively, you can:

  • The native Git comes with macOS.
  • To download and install Git, use Homebrew.

Check Git version now; you can see the latest Git version.

If the Git version is still not visible, you will need to add the Git install position to your path. In a text editor, open your ~/.profile file and add this section, where path/to/git> is the Git installation:

export PATH=$PATH:<path/to/git>

The git command is used to locate Git’s installation directory.

How to install or update Git On Windows?

Run the Git installer, be sure to put it in the same folder as every other Git download. Where git is used for identifying internal installations. Git for Windows (msysGit) downloads a supported version of Perl as well.

Choose one of the following options to ensure that git.exe is available in the path:

  • Run Git from the Windows Command Prompt with the included Unix resources.

When downloading or updating Git for the Bitbucket case, do not select Use Git Bash only; this will not work.

now you will have the current Git version installed on your operating system.

Conclusion

Hence, we have seen how to check Git version using the git command, and if your operating system does not display any version, you might need to install git using the above guide.

Let us know your feedback or queries in the comments below. or if you know any other method to check Git version let us know.

People are also reading:

  • What is Git?
  • GitHub Vs. GitLab
  • Basic Git Commands
  • How to install Git on CentOS 7?
  • How to check Linux Version?
  • Linux Commands Cheat Sheet
  • How to check node.js version?

  • Как узнать версию windows с помощью командной строки
  • Как узнать версию windows 10 через cmd
  • Как узнать версию explorer на windows 10
  • Как узнать виртуальную память компьютера windows 10
  • Как узнать версию сборки windows 11