1

I restart the VS code and switch from one branch to another branch its showing as .env permission denied. I switched to new branch but can't able to unstage, and commit this branch bez of permission denied.

    e5608MINGW32 /c/workspace/myworkspace/angular/project (sprint15/feature/IS-894-locally-installed-application-issue)
    $ git checkout sprint/IS-1767-in-tune-API-UI
    error: unable to create file .env: Permission denied
    Checking out files: 100% (98/98), done.
    Switched to branch 'sprint/IS-1767-in-tune-API-UI'
    D       .env
    Your branch is up to date with 'origin/sprint/FIS-1767-in-tune-API-UI'.
    e5608MINGW32 /c/workspace/myworkspace/angular/project (sprint/IS-1767-in-tune-API-UI)
Shridhar R Kulkarni
  • 6,653
  • 3
  • 37
  • 57
Rijo
  • 2,963
  • 5
  • 35
  • 62

1 Answers1

1

As seen here, this is usually seen when another Windows process is keeping an handle on the resource (here .env) to modify.

Another would be when two processed are running with different account.

In all cases, as commented, closing/restarting should help.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250