# GitInfo

> Identifies a specific revision for a Git package using a Git commit hash.

## Definition

* **Type:** Class
* **Namespace:** [UnityEditor.PackageManager](/engine/6000.7/script-reference/unityeditor/packagemanager.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public class GitInfo
```

## Remarks

* Available only for packages installed from Git repositories.
* The hash property always contains the full commit hash.
* The revision property can contain a branch name, tag, or commit hash, depending on how the package was installed.

```csharp
using System;
using UnityEngine;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;

[ExecuteInEditMode]
public class PackageGitInfoExample : MonoBehaviour
{
    ListRequest m_ListRequest;

    void Start()
    {
        Debug.Log("Listing packages and looking for a git package...");
        m_ListRequest = Client.List();
    }

    void Update()
    {
        if (m_ListRequest != null && m_ListRequest.IsCompleted)
        {
            if (m_ListRequest.Status == StatusCode.Success)
            {
                foreach (var package in m_ListRequest.Result)
                {
                    if (package.git != null)
                    {
                        Debug.Log($"Git package found: {package.name}");
                        Debug.Log($"- Repository: {package.repository.url}");
                        Debug.Log($"- Revision: {package.git.revision}");
                        Debug.Log($"- Commit Hash: {package.git.hash}");
                    }
                }
            }
            else
            {
                Debug.Log($"Package list request failed: {m_ListRequest.Error}");
            }
            m_ListRequest = null;
        }
    }
}
```

**Related information**

* [PackageInfo](/engine/6000.7/script-reference/unityeditor/packagemanager/packageinfo.md)
* [Client.List](/engine/6000.7/script-reference/unityeditor/packagemanager/client/list.md)
* [Package Manager Git URLs](/engine/6000.7/manual/packages-list/upm-git-dependencies/upm-git.md)

## Properties

| Property                                                                                   | Description                                                                       |
| ------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| [hash](/engine/6000.7/script-reference/unityeditor/packagemanager/gitinfo/hash.md)         | Returns the resolved Git commit hash for the requested revision for this package. |
| [revision](/engine/6000.7/script-reference/unityeditor/packagemanager/gitinfo/revision.md) | Returns the requested Git revision for the Git package.                           |
