Re: Feature request: prevent push -f from pushing all branches at once

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dany,

Dany wrote:

> I had a pretty sucky thing happen to me today: while remote tracking
> a non-master branch, I force pushed. This had the intended effect of
> force pushing the branch I was working on, but also the unintended
> function of force pushing all branches I wasn't on.

Yeah, I agree that this is lousy.

When you run "git push" or "git push -f" without further arguments,
current versions of git print a long message:

| $ git push
| warning: push.default is unset; its implicit value is changing in
| Git 2.0 from 'matching' to 'simple'. To squelch this message
| and maintain the current behavior after the default changes, use:
| 
|   git config --global push.default matching
| 
| To squelch this message and adopt the new behavior now, use:
| 
|   git config --global push.default simple
| 
| See 'git help config' and search for 'push.default' for further information.
| (the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
| 'current' instead of 'simple' if you sometimes use older versions of Git)

This is intended as a warning that git is not necessarily going to
push the branches that you intended, with instructions for teaching
git what you actually meant.  For historical reasons (to support
habits and scripts) the current default is the "push matching
branches" behavior you ran into, but in the future the default will be
a more conservative "push the current branch, and only if it is
configured to pull from the matching branch", allowing this long
message to go away.

What version of git are you using?  Any ideas about how that message
could be improved?  (Perhaps it is too long to work as an effective
warning.)

Thanks and hope that helps,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]