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

Re: Q. regarding subtree merge

From
SBSanti Béjar <sbejar@gmail.com>
Date
Apr 18, 2008, 10:09 UTC
Message-ID
<8aa486160804180309o26ab9c69j2b3b665a280bf7c4@mail.gmail.com>
In-Reply-To
<8aa486160804180302m43a7c942la93954401741b264@mail.gmail.com>
On Fri, Apr 18, 2008 at 12:02 PM, Santi Béjar <sbejar@gmail.com> wrote:
Show 47 quoted lines
>
> On Fri, Apr 18, 2008 at 11:36 AM, Stefan Näwe
>  <stefan.naewe+git@gmail.com> wrote:
>  > Hi all.
>  >
>  >  I tried the scenario described in
>  >  $GIT_DIR/Documentation/howto/using-merge-subtree.txt and have some problems
>  >  with it.
>  >
>  >  My setup:
>  >
>  >  I use git to track my changes in three different "project directories", lets
>  >  say:
>  >
>  >  ...../src_root/libfoo
>  >  ...../src_root/appbar
>  >  ...../bin_root/installed
>  >
>  >  All three git repositories contain a topic branch (lets say 'current-work')
>  >  that I want to track.
>  >
>  >  Now I want to setup one git repository containing only the three directories
>  >  'libfoo', 'appbar', and 'installed' that others can clone easily. Reading the
>  >  above howto document, I think this should be possible.
>  >
>  >  I do:
>  >
>  >   $ mkdir super-prj
>  >   $ cd super-prj
>  >   $ git init
>  >   $ git add remote -f libfoo ../path/to/src_root/libfoo
>  >
>  >  OK. No problem.
>  >
>  >  The problem arises after the second step of the howto:
>  >
>  >   $ git merge -s ours --no-commit libfoo/current-work
>  >
>  >  Now, all files of 'libfoo' are in the current directory. This is not what I
>  >  want.
>  >
>  >  Could someone please tell me what I'm doing wrong?
>
>  You are trying to merge libfoo with an empty project, so the merge
>  just "fast-forward" to the other commit as you do not have an "ours".
>
>  Simply skip the merge step.

Ups, I think you have to specify the parent for the new commit. Maybe change the merge step with:

$ git reset --soft libfoo/current-work
Santi
Previous: Santi BéjarNext: Stefan Näwe
Message 3 of 5 in “Q. regarding subtree merge”
  1. Stefan NäweApr 18, 2008
  2. Santi BéjarApr 18, 2008
  3. Santi BéjarApr 18, 2008
  4. Stefan NäweApr 18, 2008
  5. Santi BéjarApr 18, 2008

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.