Main Content

Get SVN File Locks

To ensure users remember to get a lock on model files before editing, you can configure SVN to make model files read only. Follow the steps in Enforce SVN Locking Model Files Before Editing. After you configure SVN to make files with certain extensions read only, then users must get a lock on these read-only files before editing.

  1. In a project, in any Files view, select the files you want to check out.

  2. Right-click the selected files and select Source Control > Get File Lock.

    Get File Lock is for SVN. This option does not modify the file in your local sandbox. Git™ does not have locks.

    A lock symbol appears in the SVN source control column. Other users cannot see the lock symbol in their sandboxes, but they cannot get a file lock or check in a change when you have the lock. To view or break locks, click Locks on the Project tab.

Note

To get a fresh local copy of the file from the repository, select Update from SVN.

In the Simulink® Editor, if an open model belongs to a project under SVN, you can get a lock by selecting File > Project > Get File Lock.

If you see an SVN message reporting a working copy locked error, remove stale locks by clicking SVN Cleanup in the Source Control section on the Project tab. SVN uses working copy locks internally and they are not the file locks you control using Get File Lock.

Note

Starting in R2020a Update 5, SVN cleanup only removes stale locks and unfinished transactions. It does not remove unversioned or ignored files.

You can manually remove unversioned and ignored files.

  1. In the Files view, in the All tab, click the SVN header to sort files by their SVN status.

  2. Select the Not Under Source Control files.

  3. Right-click and select Delete.

Manage SVN Repository Locks

To manage global SVN locks for a repository, on the Project tab, in the Source Control section, click Locks.

In the SVN Repository Locks dialog box, you can:

  • View which users have locks on files.

  • Right-click to break locks.

  • Group locks by user or file.

Related Examples

More About