Git development
 help / color / mirror / Atom feed
From: Dany <nessup@gmail.com>
To: git@vger.kernel.org
Subject: Feature request: prevent push -f from pushing all branches at once
Date: Wed, 3 Jul 2013 16:30:27 -0700	[thread overview]
Message-ID: <ADE9FE42-FC10-4976-8E6A-290B101DD17A@gmail.com> (raw)

Hi,

I had a pretty sucky thing happen to me today: while remote tracking a non-master branch, I force pushed. This had the intended effect of force pushing the branch I was working on, but also the unintended function of force pushing all branches I wasn't on.

I'm open to anyone's thoughts about this (or even a suggestion as to how to avoid this in the future), but as far as I know, in 99% of cases, a developer does not intend to force push all branches he is remote tracking on his system when he types `git push -f`. Now I know that that's what will happen, but I wonder why git does this (and, furthermore, why git doesn't prevent force pushing multiple branches at once.)

Again, I think the case where one intends to force push many branches is certainly not as common as the case where one intends to force push one branch, so why does git's default behavior leave the user in the position of fscking himself over pretty badly?

Would love any thoughts or suggestions on this.

Thanks,
--Dany.

             reply	other threads:[~2013-07-03 23:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-03 23:30 Dany [this message]
2013-07-03 23:38 ` Feature request: prevent push -f from pushing all branches at once Jonathan Nieder
2013-07-04  8:06 ` Matthieu Moy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ADE9FE42-FC10-4976-8E6A-290B101DD17A@gmail.com \
    --to=nessup@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox