Skip to content
English
  • There are no suggestions because the search field is empty.

Resolving Git Lock File Errors in Copia Desktop

How to Fix "Lock File Detected" Errors That Prevent Copia Repository Operations

Overview

When Copia Desktop encounters a lock file inside a repository's .git folder, it will block further operations such as updates, commits, or syncs. This error typically occurs when another process was actively using the repository and did not exit cleanly, leaving behind an index.lock file that Git treats as a signal that another operation is still in progress.

Copia and Git Lock Files

Copia Desktop uses Git under the hood to manage source control for your PLC programs and project files. When an operation like an update or commit starts, Git creates a temporary index.lock file to prevent conflicting changes. Under normal circumstances, this file is automatically removed when the operation completes. However, if the process is interrupted — due to a crash, force close, or an external tool like an editor or terminal still accessing the repo — the lock file can be left behind, blocking all future operations until it is manually removed.

Solution

To resolve the lock file error, follow the steps below:

  1. Close Copia Desktop, VS Code, Studio 5000(or any other editor), and any terminal windows that may have the affected repository open.
  2. Open Task Manager and end any running processes named git.exe, if present.
  3. Open File Explorer and navigate to the .git folder inside your repository. For example: C:\Users\YourUsername\Documents\Copia\YourRepository\.git\
  4. Locate and delete the file named index.lock.
  5. Re-open Copia Desktop and retry the operation.

OneDrive and Other Sync Tools

A common cause of recurring lock file errors is storing your Copia repository inside a folder that is actively synced by OneDrive or a similar cloud sync service. OneDrive can interfere with Git's internal .git files while syncing, occasionally creating or locking files at the wrong time.

If the issue returns after following the steps above, consider one of the following:

  • Move the repository to a local, non-synced location such as C:\CopiaRepos\YourRepository\
  • Exclude the repository folder from OneDrive sync in your OneDrive settings

Keeping repositories outside of synced folders is the recommended long-term solution to prevent this issue from recurring.