Re: git push default behaviour?
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Mar 8, 2012, 18:35 UTC
- Message-ID
- <vpq1up3aqk8.fsf@bauges.imag.fr>
- In-Reply-To
- <7vlinbdkb0.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 6 quoted lines
> If you publish to your own repository > and let others pull, the behaviour is not dangerous at all with or > without --force (well, --force brings its own danger but that does > not have anything to do with which branches are pushed). If you > default to 'current' in such a workflow, you risk forgetting to > push, which is the more dangerous option between the two.
Forgetting to push a branch is a danger, but far less dangerous than what "push --force" can do in a shared repository.
In a shared repository, there's actually a race condition that you cannot avoid AFAICT:
$ git push # get an error about non-fast-forward on branch A, but no other. # thing "it's OK, I do want to do a forced update on A". $ git push --force
If someone else did a push between my first push and the "push --force", then the other user's push is discarded.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/