Version control - is it possible to reconnect via script?

I’ve repeatedly observed an issue where Unity becomes disconnected from version control (configured via ProjectSettings->Editor) as a result of a temporarily dropped network connection. This can be detected in script via VersionControl.Provider.onlineState, but what I want is an API call to attempt to reconnect so that Unity doesn’t sit in a disconnected state unnecessarily. Once disconnected, the user needs to click “Connect” and until they do so, changes are not tracked through version control.

Is there already a way to reconnect to version control via script? I’m hoping I’ve just overlooked it.

Cheers

9 years late…
I certainly don’t know if this is the correct way to do this but calling UpdateSettings() seems to connect. Hopefully this might be useful to someone 9 years from now :slight_smile:

UnityEditor.VersionControl.Provider.UpdateSettings();