DEV Community

Discussion on: How to Undo Pushed Commits with Git

Collapse
 
alco profile image
Jakub Stibůrek

Why not? The option is there.

Thread Thread
 
blackgirlbytes profile image
Rizèl Scarlett

Here’s an article on why it’s sometimes dangerous : blog.developer.atlassian.com/force...

Thread Thread
 
alco profile image
Jakub Stibůrek

Thanks, I'll have a look. But I reacted more to the "never".

Thread Thread
 
blackgirlbytes profile image
Rizèl Scarlett

Gotcha..I agree..never is a little strong lol. There's exceptions.

Thread Thread
 
christiankozalla profile image
Christian Kozalla • Edited

Although git is a distributed VCS and the client repositories are more or less independent, it is most common that the one remote repository is treated as the single source of truth.

Force pushing to that remote repo is essentially like saying 'screw what others might have pushed before, my local copy is the new single source of truth now'

The king is dead, long live the king!

Thread Thread
 
blackgirlbytes profile image
Rizèl Scarlett

You explained that pretty well! Going to refer to your response every time someone questions why I’m not using git push force