Trying to add image in Git add but keep getting the following message? I tried restarting/reloading git and closing VS Code but nothing worked

That looks like a git bash session on Windows, or a WSL session.

If you can not easily identify the process which keeps an handle to that file, preventing another program (like git) to access it, I would:

  • reboot
  • restart my git bash or WSL2 session
  • try to add img/cake.jpg before opening any IDE.

Since it is an Ubuntu session, I would also try, for tesdting:

sudo chmod -R 755 img

That way, the folder img will be accessible.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top