git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: remotes

From
Stefan Beller <sbeller@google.com>
Date
May 3, 2016, 23:47 UTC
Message-ID
<CAGZ79kat4rW7raoXQNF2mb0nS5qF0e7yTCoSkiFe2VFJ=E_VdA@mail.gmail.com>
In-Reply-To
<20160504013624.4c51ce42@wind.levalinux.org>
On Tue, May 3, 2016 at 4:36 PM, Kovacs Levente <leventelist@gmail.com> wrote:
Show 28 quoted lines
> 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

Show 8 quoted lines
>
> Thanks,
> Lev
>
>
> --
> 73 de HA5OGL
> Op.: Levente
Previous: Kovacs LeventeNext: Junio C Hamano
Message 4 of 6 in “remotes”
  1. LevMay 3, 2016
  2. Junio C HamanoMay 3, 2016
  3. Kovacs LeventeMay 3, 2016
  4. Stefan BellerMay 3, 2016
  5. Junio C HamanoMay 4, 2016
  6. Junio C HamanoMay 4, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.