Unity Version Control Extension for Visual Studio
Use version control in your IDE.
Read time 4 minutesLast updated 21 days ago
The Unity Version Control (UVCS) extension works to enhance Visual Studio and allow you to connect and work with your Unity Dashboard repositories. The extension uses your CLI credentials to add UVCS features and built-in controls to effectively manage your version control workflow:
- Open your solution and code directly in your UVCS workspace.
- Create and switch branches, and shelve or check in your changes.
- View the status of your files, and view any modified files.
- Track file history and diffs, and annotate your files.
Prerequisites
- Visual Studio 2022 (versions 17.0 or higher).
- Unity DevOps Version Control desktop application. For information on how to install the desktop application, refer to Download the desktop client.
- A UVCS workspace and solution.
Install the UVCS Extension
You can install the UVCS Visual Studio extension from your Visual Studio application:- Select Extensions > Manage Extensions.
- Search for Unity Version Control Extension for Visual Studio.
- Select Install.
Select UVCS as your Source Control
You need to configure Visual Studio to use Unity Version Control as the source control plug-in:- In your Visual Studio application, select Tools > Options.
- From the options, select Source Control > Plug-in Selection.
- From the dropdown, select Unity Version Control System and select OK.
Open a solution
For the UVCS extension to work, you need to open a solution from an existing UVCS workspace. You can create a workspace in the UVCS Unity Dashboard.Version Control options
To open the UVCS extension specific option menu, you can right-click on a file and select Unity Version Control.Operation | Description |
|---|---|
| Add to source control | Manually add a private file to your source control. |
| Checkout | Check out a file to indicate that you want to modify it. If you have pre-configured lock rules, these apply to files you check out. |
| Check in | Check in any modified files to your source control. |
| Undo changes | Revert a change to a file. |
| History | View a file’s previous changesets and modifications. |
| Annotate | View the author of any changes made to a file and when the changes were made. |
| Diff with previous | View the diff of the current file with the previous version. |
| Diff | View a full diff of the current file. |
UVCS Changes panel
The UVCS Changes window displays new and changed files in your local version of the project. Use this tab to check in your files to the UVCS workspace, exclude files from version control, and compare changed files with the previously checked-in version. To view more information about the repository, you can hover over a file in the pending changes list. To view more information about the specific changeset and location, you can hover over the branch icon.Check-in
To include file modifications in your workspace and allow your collaborators to access them, you need to check them in. When you check in your files, the UVCS Changes window refreshes and no longer lists the files you have checked in. The files that you check in compile into a changeset, which you can view in the UVCS Workspaces window. To check in files:- Select the files you want to check in.
- In the text field, enter a comment to explain your changes.
- Select the Check-in button.
Shelve
If you don’t want to add your changes to your workspace, but you do want to keep them, you can shelve the changes and return to them later:- Select the files you want to shelve.
- In the text field, enter a comment to explain your changes.
- Select the Shelve button.
- Select whether you want to remove the changes from the pending changes list after you shelve them.
- Preview: to preview the shelved changes
- Apply: to restore the shelved changes to your current workspace.
- Delete: to remove the changes entirely.
Undo
If you’ve made changes in your project that you don’t want to keep, you can revert back to the latest checked-in version. To revert changes to a file:- Select any files you want to remove.
- Select the Undo button and confirm Yes.
UVCS Workspaces panel
The UVCS Workspaces window lists the changesets in your workspace. This window shows the following information about each changeset:- The changeset ID
- The date the changeset was made.
- The owner of the changeset.
- Any comments on the changeset.
- The branch the changeset is on.
Options
To view the options, right-click on the changeset:Option | Description |
|---|---|
| View details | Open a details panel below the changeset list. |
| Switch workspace to this changeset | Revert your local workspace to the state it was in at a previous changeset. |
| Create branch from this changeset | Create a new branch in the state of the changeset. |