3 ms·
I have a horrible feeling your answer to this is going to stress me out, but does that work even without a force push?
by mcintyre1994 6y ago
I have a horrible feeling your answer to this is going to stress me out, but does that work even without a force push?
- jorams 6y agoYes, --mirror implies a level of force. The man page contains this: "...locally updated refs will be force updated on the remote end, and deleted refs will be removed from the remote end..."
- hvidgaard 6y agoThat breaks a very simple rule that a VCS tools should adhere consistently. Do not make destructive changes unless explicitly told to. Since most other commands to not allow you to do this without -f, the same should apply here.
- jorams 6y agoI'm not sure I see your point. The entire reason `git push --mirror` exists is to turn the remote end into a mirror of the local end. By definition that's a destructive operation. What would it do without a further --force? If you just want to push all branches or tags you should use --all or --tags.
- hvidgaard 6y agoBecause you normally cannot make remote destructive changes without the --force. Unless you know the commands that does that by default. That is bad UX.
- ziml77 6y agoProbably because removing branches from the remote doesn't make the commit history inconsistent with any copies made before the push. That seems to be the only case where git second-guesses what you tell it to do.