If the .git directory is unavailable in the local checkout, is it still possible to know what was the commit hash of the local checkout? Assume that the local checkout was periodically pushed to remote origin.
git status depends on the .git directory which is futile in this case.
I could make a bash script with a diff to loop around every commit. Hoping for something more elegant and less brute-force.
How did I end up here:
- I did a
pip install <git_origin_repo>@<commit_hash>long ago. - It had installed the pip package in the site-packages directory. The .git directory is not created as pip probably sees no further use for it.
Now, I am trying to find out which commit hash it was that I had installed the package with.