Welcome to "TWIL," the weekly digest where we distill the latest insights our team has gathered on complex topics into bite-sized teachable moments. This week, Emily dissects the safe execution of Force Push with Lease in Git, bringing clarity to how developers can ensure their repository contributions are respected and protected. Join us to discover how careful use of force push can maintain harmony within your codebase.
Force Push with Lease
TLDR; Force push over your own commits, not other people's!
Add to your gitconfig
[alias]
pf = push --force-with-lease
and then use with:
# instead of
git push --force-with-lease origin feature-branch
# use
git pf feature-branch
Resources
- Git