esmero / archipelago-deployment-live

A Cloud / Local production ready Archipelago Deployment using Docker / Kubernetes
GNU General Public License v3.0
3 stars 13 forks source link

Avoid git pull/merge or rebase failing (but still bringing files) on wrong permissions #85

Open DiegoPino opened 2 years ago

DiegoPino commented 2 years ago

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 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)

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 -fexcept if you know what you are doing.. FORCING might bring doom.