Avoid git pull/merge or rebase failing (but still bringing files) on wrong permissions #85
Labels
documentation
Improvements or additions to documentation
Github
re-basing our friendships
Release Duties
Things nobody wants to do
Utility and Scripts
Bash-ing the world one line at the time
Milestone
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
BUTprovide 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.The text was updated successfully, but these errors were encountered: