Re: git push default behaviour?
- From
Marc Branchaud <marcnarc@xiplink.com>
- Date
- Mar 8, 2012, 15:00 UTC
- Message-ID
- <4F58C977.8000400@xiplink.com>
- In-Reply-To
- <1331203321.21444.13.camel@beez.lab.cmartin.tk>
On 12-03-08 05:42 AM, Carlos Martín Nieto wrote:
Show 8 quoted lines
> On Thu, 2012-03-08 at 10:38 +0000, Jeremy Morton wrote: >> But 'push --force' WILL try to push your (probably outdated) master >> upstream, killing any changes there made since you last updated. That >> alone is so dangerous it seems like reason enough to avoid it by >> default. > > Then don't use --force without specifying exactly what you want. > Anything with that option needs to be used carefully.
I agree with Jeremy that the default is dangerous, or at the very least surprising.
Perhaps --force should be changed to require an explicit ref if push.default = matching (and the code finds that it needs to use push.default's value)?
By itself that change would make it impossible to use --force to force-change all matching refs (i.e. the current default behaviour would disappear completely). I'm OK with that, personally.
M.