3 ms·
What exactly does CMD+Z do for a push?
by preek 15y ago
What exactly does CMD+Z do for a push?
- oleganza 15y agoIt pushes previous commit ID into the remote branch.
- preek 15y agoIf it doesn't revert the last commit, what you say would be a forced push, correct?
- oleganza 15y agoYes, it's a force push. Useful when you accidentally pushed just a couple of seconds ago and want to undo. Of course, if people have already pulled it, they'll have to rebase or reset the branch later.
- tux1968 15y agoTeaching people to use Git incorrectly is a bad UI design decision.
- preek 15y agoSince I can't reply to your reply, I'm answering right here. Are you sure it's good practice to force other people to rebase, because you did a mistake? That's exactly what I was afraid of what CMD+Z did.
- oleganza 15y agoIf you are quick enough and project is small and everyone is in the same room (or it's just you with an iMac and laptop), it's very-very convenient. People who start using Git and/or using it as a sole committers value such convenience a lot.
- preek 15y agoI get that. But it's also sending me red flashing lights, because people with GUIs sometimes not only 'value such convenience a lot', sometimes they don't know better.
- docgnome 15y agoI agree. Rewriting public history causes lightening to fall from the sky and strike you down. Also everyone then hates you. This is what I've had problems with Git UI's the in past... They try to make git easier and as a result tend to hide, or gloss over, very important details. Rewriting history is a non-trivial thing to do and should be done with the utmost care.
- spicyj 15y agoCan you put up a warning dialog, at least, when doing a force push?
- oleganza 15y agoSince I can't reply to your reply, I'm answering right here. If someone does that and it messes things for other guys, it just takes extra 5 minutes to teach him/her how Git works and what to do. And everybody benefits.