Unity: Unable to commit changes - Temp/Unitylockfile error

Prerequisites

  • Be sure to run with tracing enabled to capture runtime details in the log file
  • Include the log file in the PR.
    • On Windows, the extension log file is at %LOCALAPPDATA%\GitHubUnity\github-unity.log
    • On macOS, the extension log file is at ~/Library/Logs/GitHubUnity/github-unity.log
    • On linux, the extension log file is at ~/.local/share/GitHubUnity/github-unity.log

Description

Unable to commit changes.

Steps to Reproduce

  1. Select files to commit and add description
  2. click commit

Expected behavior: I expect the changes to be commited

Actual behavior: After processing, the list of files under changes does not change and nothing is actually commited.

Reproduces how often: 100%

Additional Information

Any additional information, configuration or data that might be necessary to reproduce the issue.

GitHub.Unity.ProcessException: error: open("Temp/UnityLockfile"): Permission denied
error: unable to index file Temp/UnityLockfile

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Find Temp/UnityLockfile in the changed files on the left in Github Desktop. Right-click -> ignore file

For me, closing Unity just to add the objects and commit worked.

Hello. I solved this problem with the instruction: echo “Temp/*” >> .gitignore

For anyone else having this problem, my solution was to change my .gitignore file to have a wild card before all the unity folders. My git directory was one folder above my unity project(so like “Gitfolder/UnityProject/Temp”), and as it looks like the .gitignore was expecting to be at the same level as the Temp folder(and other folders) it was not excluding the folders. Not sure if this will break anything, if not I would suggest GitHub change their default unity ignore file.

Uhm, also does someone know how to post their gitignore file? I tried code, which as you can see bellow didn’t work out well.

`# This .gitignore file should be placed at the root of your Unity project directory

Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore

*/[Ll]ibrary/ */[Tt]emp/ */[Oo]bj/ */[Bb]uild/ */[Bb]uilds/ */[Ll]ogs/ */[Mm]emoryCaptures/

Never ignore Asset meta data

!/[Aa]ssets/**/*.meta

Uncomment this line if you wish to ignore the asset store tools plugin

/[Aa]ssets/AssetStoreTools*

TextMesh Pro files

/[Aa]ssets/TextMeshPro/

Autogenerated Jetbrains Rider plugin

/[Aa]ssets/Plugins/Editor/JetBrains

Visual Studio cache directory

*/.vs/

Gradle cache directory

.gradle/

Autogenerated VS/MD/Consulo solution and project files

*ExportedObj/ .consulo/ *.csproj *.unityproj *.sln *.suo *.tmp *.user *.userprefs *.pidb *.booproj *.svd *.pdb *.mdb *.opendb *.VC.db

Unity3D generated meta files

*.pidb.meta *.pdb.meta *.mdb.meta

Unity3D generated file on crash reports

*/sysinfo.txt

Builds

*.apk *.unitypackage

Crashlytics generated file

crashlytics-build.properties

`

Don’t forget to change the .gitignore in the repository folder:

It should have something like this: /[Ll]ibrary/ /[Tt]emp/ /[Oo]bj/ /[Bb]uild/ /[Bb]uilds/ /[Ll]ogs/ /[Mm]emoryCaptures/

Remove the first slashes: [Ll]ibrary/ [Tt]emp/ [Oo]bj/ [Bb]uild/ [Bb]uilds/ [Ll]ogs/ [Mm]emoryCaptures/

For me, closing Unity just to add the objects and commit worked.

Yes, this worked for me too 😃

For me it was about having the unity editor open while adding files to commit. Closed the editor and it worked fine

Hello. I solved this problem with the instruction: echo “Temp/*” >> .gitignore

Where did you write this?

@elvinsadiq In the root of your Unity project - the directory that has the Assets/ProjectSettings/Temp folders in it - edit the .gitignore file (or create one there if there isn’t one), and add the following line to it:

Temp/

This will make sure your Temp folder is ignored by git.