In my case the file is a shell script (*.sh
file) meant to deploy our project to a local development server, for my developers.
The shell script should work consistently and may be updated; so I tracked it in the same Git project as the code which the script is meant to deploy.
The shell script runs one executable, and then allows that executable to run; so the script is still running; so my shell still has the script open; so it's locked.
I Ctrl+C
'd to kill the script (so now my local dev server is no longer accessible), now I can checkout freely.