1
1
1210mk22019-07-31 11:39:34
git
1210mk2, 2019-07-31 11:39:34

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~1and 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

1 answer(s)
O
OnYourLips, 2019-07-31
@OnYourLips

Remove the folder from the project and add it to .gitignore.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question