push: document & test --force-with-lease with multiple remotes
commitf17d642d3b0fa64879d59b311e596949f2a1f6d2
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 19 Apr 2017 09:22:03 +0000 (19 09:22 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Apr 2017 01:53:06 +0000 (19 18:53 -0700)
treedf003ca2ee3da78cd623fb4baef92a7a2934c3d5
parent49800c940790cc7465d1b03e08d472ffd8684808
push: document & test --force-with-lease with multiple remotes

Document & test for cases where there are two remotes pointing to the
same URL, and a background fetch & subsequent `git push
--force-with-lease` shouldn't clobber un-updated references we haven't
fetched.

Some editors like Microsoft's VSC have a feature to auto-fetch in the
background, this bypasses the protections offered by
--force-with-lease & --force-with-lease=<refname>, as noted in the
documentation being added here.

See the 'Tools that do an automatic fetch defeat "git push
--force-with-lease"' (<1491617750.2149.10.camel@mattmccutchen.net>)
git mailing list thread for more details. Jakub Narębski suggested
this method of adding another remote to bypass this edge case,
document that & add a test for it.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-push.txt
t/t5533-push-cas.sh