DEV Community

Discussion on: Git Concepts I Wish I Knew Years Ago

Collapse
 
eltonvs profile image
Elton Viana

Hey Gabriel, nice article!

I would add another command in order to have a less destructive force push: git push --force-with-lease (or ggfl when using oh my zsh).
This works like a git push --force, but will not override the upstream branch if there's some modification. I usually default to this command when pushing my rebased branches.

Here's an article with a good explanation about that: blog.developer.atlassian.com/force...