git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Beller <sbeller@google.com>
To: Kovacs Levente <leventelist@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: remotes
Date: Tue, 3 May 2016 16:47:47 -0700	[thread overview]
Message-ID: <CAGZ79kat4rW7raoXQNF2mb0nS5qF0e7yTCoSkiFe2VFJ=E_VdA@mail.gmail.com> (raw)
In-Reply-To: <20160504013624.4c51ce42@wind.levalinux.org>

On Tue, May 3, 2016 at 4:36 PM, Kovacs Levente <leventelist@gmail.com> wrote:
> On Tue, 03 May 2016 13:38:22 -0700
> Junio C Hamano <gitster@pobox.com> wrote:
>
>> Lev <leventelist@gmail.com> writes:
>>
>> > I accidentally added a remote of another repository to my config
>> > file. And so I merged two different repositories together. Is there
>> > any real user case for this?
>>
>> Using multiple remotes is a perfectly normal way in which you are
>> expected to interact with a single project with other participants.
>> Perhaps there is one single authoritative and canonical repository
>> where everybody initially clones from, and it is likely that that
>> repository is your "origin".  Often there are cases where another
>> participant has a topic that is not yet ready for the mainline but
>> is worth considering for early adopters and/or is solid enough for
>> other project participants to build their work on.  In such cases,
>> you can add the repository of that other participant as the second
>> remote and fetch from her.
>
> Yes, I use that feature.
>
>> It makes no sense if the two repositories hold histories of totally
>> unrelated projects, of course.
>
> Would it make sense to implement some protection against these kind of
> accidents? At least a question "are you sure you want to merge two
> independent repositories/branches?"

A recent addition is the check for unrelated histories via checking for added
root commits (i.e. commits with no parent) and refusing to merge them
by default.
you need to pass --allow-unrelated-histories to merge.

see
https://kernel.googlesource.com/pub/scm/git/git/+/e379fdf34fee96cd205be83ff4e71699bdc32b18

>
> Thanks,
> Lev
>
>
> --
> 73 de HA5OGL
> Op.: Levente

  reply	other threads:[~2016-05-03 23:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03 16:16 remotes Lev
2016-05-03 20:38 ` remotes Junio C Hamano
2016-05-03 23:36   ` remotes Kovacs Levente
2016-05-03 23:47     ` Stefan Beller [this message]
2016-05-04  7:04       ` remotes Junio C Hamano
2016-05-04  8:11         ` remotes Junio C Hamano

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='CAGZ79kat4rW7raoXQNF2mb0nS5qF0e7yTCoSkiFe2VFJ=E_VdA@mail.gmail.com' \
    --to=sbeller@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=leventelist@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).