Using external version control systems with Unity
Plastic SCM Integration
Plastic SCM is version control software. For more information on Plastic SCM, see their website.
To set up Plastic SCM, see their documentation on setting up Plastic SCM. For information on setting up version control in Unity, see the documentation on version control.
Checking files out with Plastic SCM
Plastic SCM automatically checks files out if you have modified them. The only files that require specific checking out instructions are Project SettingsA broad collection of settings which allow you to configure how Physics, Audio, Networking, Graphics, Input and many other areas of your Project behave. More info
See in Glossary files, otherwise you can’t change them.
Resolving conflicts and merging with Plastic SCM
You’ll need to perform a merge when you edit something in your Project locally which has also been edited remotely (a conflict). This means you need to review the changes before you can perform the merge. If Unity recognises that you need to perform a merge before you submit changes then it will prompt you to complete the merge. This will take you to the Plastic SCM client.
If incoming changes conflict with local changes then a question mark icon appears on the conflicting files in the incoming changes window. Here is a quick guide to resolving conflicts and merging with Plastic SCM:
- In the Version ControlA system for managing file changes. You can use Unity in conjunction with most common version control tools, including Perforce, Git, Mercurial and PlasticSCM. More info
See in Glossary window select the Apply all incoming changes button. This automatically takes you to the Plastic SCM GUI client.
- In the client window, click Explain merge for a more visual understanding of the changes. Select Process all merges and another window displays.
- This window shows the individual conflicts, and you can choose what changes you want to keep or discard.
- Once you have resolved the conflicts, select save and exit, and Plastic SCM will complete the merge operation.
- Push the changes through Unity’s Version Control window.
Locking Files with Plastic SCM
To lock files with Plastic SCM, perform the following actions:
- Create a lock.conf file and place it in your server directory. You can find your server directory in
../PlasticSCM/server
.
- In the lock.conf file, specify the repository you are working on and the server to complete the lock checks. Here is an example:
rep:default lockserver:localhost:8087
*.unity
*.unity.meta
In this case all .unity and .unity.meta files are going to be locked for checkout on repository ‘default’.
- Restart the server by opening a terminal/command line window and locating the server directory. Once in the directory you can restart the server with the command
./plasticsd restart
.
- Open the Unity Editor and check out a file that you expect to be locked, then go back to the terminal/command line and type:
cm listlocks
- The terminal/command line window displays a list of locked files. You can also test if this has worked by trying to check out the same file using a different user. An error will appear in Unity’s console saying the file is already checked out by another user.
For more information you can visit the Plastic SCM lock file documentation.
Differences from Perforce
PlasticSCM does not support remote activity, like PerforceA version control system for file change management. More info
See in Glossary does. As such, this functionality is unavailable for Plastic SCM in the Editor. Statuses such as: “Checked out Remote” or “Out of Sync” aren’t displayed in the Project Window.
Distributed and offline work with Plastic SCM
For more information about working in distributed mode (DVCS) and offline with Plastic SCM see Plastic SCM’s Distributed Version Control Guide.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker at issuetracker.unity3d.com.
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thanks for helping to make the Unity documentation better!
Using external version control systems with Unity