any git pull/merge or rebase that is not able to delete/add/write a file will still bring all files it can but without the actual commit, leaving a mess behind of untracked files, requiring a dangerous git stash -u (specially if your git status was unclean).
The actual solution is to run any git command as sudoBUT
provide a git hook ( a bash script we can commit inside a .git folder) that restores the permissions we need to the actual required by each docker container (www-data or 82 of drupal, etc)
NOTE: NEVER EVER (same feeling you have for me) run git stash --all. NEVER. it will stash files being ignored and it will make a mess. And never git anything with -fexcept if you know what you are doing.. FORCING might bring doom.
What?
any git pull/merge or rebase that is not able to delete/add/write a file will still bring all files it can but without the actual commit, leaving a mess behind of untracked files, requiring a dangerous
git stash -u
(specially if your git status was unclean).The actual solution is to run any git command as
sudo
BUT provide a git hook ( a bash script we can commit inside a .git folder) that restores the permissions we need to the actual required by each docker container (www-data or 82 of drupal, etc)See https://stackoverflow.com/questions/62412563/prevent-git-from-overwriting-file-owner-upon-git-pull
NOTE: NEVER EVER (same feeling you have for me) run
git stash --all
. NEVER. it will stash files being ignored and it will make a mess. And never git anything with-f
except if you know what you are doing.. FORCING might bring doom.