git safety
rules for git operations in this repo.
rules
- •NEVER force push (
git push --forceorgit push -f) - •NEVER
git reset --hardwithout explicit permission - •NEVER
git clean -fdwithout explicit permission - •prefer
git stashovergit reset - •always
git pullbeforegit push
forbidden commands
these require EXPLICIT user permission:
- •
git push --force - •
git push -f - •
git push --force-with-lease - •
git reset --hard - •
git clean -fd - •
git checkout -- .(discards all changes)
safe alternatives
instead of git reset --hard:
- •
git stashto save changes - •
git stash popto restore
instead of force push:
- •
git pull --rebasethen normal push - •ask user how to resolve conflicts
workflow
- •
git pullbefore making changes - •make changes
- •
git addrelevant files - •
git commit - •
git pullagain before push - •
git push(no force flags)