Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DiegoPino opened this issue Oct 12, 2022 · 0 comments
Assignees
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

Comments

@DiegoPino
Copy link
Member

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.

@DiegoPino DiegoPino self-assigned this Oct 12, 2022
@DiegoPino DiegoPino added documentation Improvements or additions to documentation Release Duties Things nobody wants to do Github re-basing our friendships Utility and Scripts Bash-ing the world one line at the time labels Oct 12, 2022
@DiegoPino DiegoPino added this to the 1.1.0 milestone Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant