Re: How to ignore changes on remote
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Mar 23, 2010, 16:20 UTC
- Message-ID
- <4BA8EA6A.4030607@viscovery.net>
- In-Reply-To
- <d411cc4a1003230905y12839743x400333a0aa2e7018@mail.gmail.com>
Am 3/23/2010 17:05, schrieb Scott Chacon:
> Why would we teach someone to do that instead of just recommending the > far less obscure 'git push -f'? A leading '+' on the refspec is > ridiculously confusing compared to "just tell it to force the push > with -f". Am I forgetting something?
-f is dangerous. I was once bitten badly by a hastily typed
git push -f repo
that pushed two branches instead of only one: One needed an urgent update (that was the good one), but it also pushed the other one, which was not yet prepared for publication.
By teaching the +refspec form, you force the user to be careful which branch is rewound. Yes, you can still say +refs/heads/*, but if you do that, you are much more explicit than with "push -f repo", where the affected branches are hidden in the config file.
-- Hannes