git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Simple git push --tags deleted all branches
@ 2018-11-28 16:50 Mateusz Loskot
  2018-11-28 18:13 ` Mateusz Loskot
  2018-11-29 15:03 ` Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 6+ messages in thread
From: Mateusz Loskot @ 2018-11-28 16:50 UTC (permalink / raw)
  To: git

Hi,

(using git version 2.19.2.windows.1)

I've just encountered one of those WTH moments.

I have a bare repository

core.git (BARE:master) $ git branch
  1.0
  2.0
* master

core.git (BARE:master) $ git tag
1.0.1651
1.0.766
2.0.1103
2.0.1200

I published the repo using: git push --all --follow-tags

This succeeded, but there seem to be no tags pushed, just branches.
So, I followed with

core.git (BARE:master) $ git push --tags
To XXX
 - [deleted]               1.0
 - [deleted]               2.0
 ! [remote rejected]       master (refusing to delete the current
branch: refs/heads/master)
error: failed to push some refs to 'XXX'

And, I've found out that all branches and tags have been
wiped in both, local repo and remote :)

I restored the repo and tried out

git push origin 1.0
git push origin --tags

and this time both succeeded, without wiping out any refs.

Could anyone help me to understand why remote-less

git push --tags

is/was so dangerous and unforgiving?!

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-12-04 19:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-28 16:50 Simple git push --tags deleted all branches Mateusz Loskot
2018-11-28 18:13 ` Mateusz Loskot
2018-11-29 15:03 ` Ævar Arnfjörð Bjarmason
2018-11-29 15:18   ` Mateusz Loskot
2018-11-29 15:39     ` Ævar Arnfjörð Bjarmason
2018-12-04 19:00       ` Mateusz Loskot

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).