Answer the question
In order to leave comments, you need to log in
How to prevent git reset --hard from killing the log folder symlink?
Hello.
There is a /storage/logs folder in the project folder, this is Laravel, but it doesn't matter.
So the folder itself is deleted and a symlink is made to /var/log/project.
Everything works fine, the logs are written according to the symlink correctly. But then the task arose to roll back the commit. I made git reset --hard HEAD~1
and received a remote symlink, and instead of it an empty logs directory with a .gitignore file.
did git ls-files
, the storage/logs/.gitignore entry hangs there.
deleted it: git rm -r storage/logs/
, repeated the experiment with the rollback of the commit. Frays.
Tell me, is the list of files for recovery stored somewhere even deeper? What needs to be done so that git does not touch the storage/logs/ folder?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question