Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetVersionControl(string)

Sets the active version control system.
Read time 1 minuteLast updated 6 days ago

Definition

public static bool SetVersionControl(string name)

Parameters

name

Unique version control system name.

Returns

Type

Description

boolReturns true if VCS has been activated. false otherwise.

Remarks

If a different VCS was previously active, it will be deactivated. You can use the VersionControlManager.versionControlDescriptors property to retrieve all the available version control systems. You can check the newly activated VersionControlObject by using the VersionControlManager.activeVersionControlObject property.
using UnityEditor;using UnityEditor.VersionControl;using UnityEngine;static class Example{ [MenuItem("Example/Set Custom VCS")] static void SetCustomVCS() { if (!VersionControlManager.SetVersionControl("Custom")) Debug.LogWarning("Failed to set custom VCS."); }}