# GetLatest

> Start a task for getting the latest version of an out of sync asset from the version control server.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.VersionControl](/engine/6000.7/script-reference/unityeditor/versioncontrol.md)
* **Assembly:** UnityEditor.CoreModule

## GetLatest(AssetList)

Start a task for getting the latest version of an out of sync asset from the version control server.

```csharp
public static Task GetLatest(AssetList assets)
```

### Parameters

**** (\[AssetList]\(/engine/6000.7/script-reference/unityeditor/versioncontrol/assetlist)): List of assets to update.

### Returns

| Type                                                                       | Description |
| -------------------------------------------------------------------------- | ----------- |
| [Task](/engine/6000.7/script-reference/unityeditor/versioncontrol/task.md) |             |

### Remarks

Note that the [Provider.GetLatest](/engine/6000.7/script-reference/unityeditor/versioncontrol/provider/getlatest.md) task does not solve file conflicts, in such cases consider using the [Provider.Resolve](/engine/6000.7/script-reference/unityeditor/versioncontrol/provider/resolve.md) method as well.

### Examples

```csharp
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.VersionControl;
using UnityEngine;

public class EditorScript : MonoBehaviour
{
    [MenuItem("Version Control/GetLatest")]
    public static void ExampleGetLatest()
    {
        AssetList assets = new AssetList();
        assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs"));
        Task t = Provider.GetLatest(assets);
        t.Wait();
    }
}
```

## GetLatest(Asset)

Start a task for getting the latest version of an out of sync asset from the version control server.

```csharp
public static Task GetLatest(Asset asset)
```

### Parameters

**** (\[Asset]\(/engine/6000.7/script-reference/unityeditor/versioncontrol/asset)): Asset to update.

### Returns

| Type                                                                       | Description |
| -------------------------------------------------------------------------- | ----------- |
| [Task](/engine/6000.7/script-reference/unityeditor/versioncontrol/task.md) |             |

### Remarks

Note that the [Provider.GetLatest](/engine/6000.7/script-reference/unityeditor/versioncontrol/provider/getlatest.md) task does not solve file conflicts, in such cases consider using the [Provider.Resolve](/engine/6000.7/script-reference/unityeditor/versioncontrol/provider/resolve.md) method as well.

### Examples

```csharp
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.VersionControl;
using UnityEngine;

public class EditorScript : MonoBehaviour
{
    [MenuItem("Version Control/GetLatest")]
    public static void ExampleGetLatest()
    {
        AssetList assets = new AssetList();
        assets.Add(Provider.GetAssetByPath("Assets/ExampleAsset.cs"));
        Task t = Provider.GetLatest(assets);
        t.Wait();
    }
}
```
