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

Trouble merging to master when topic branch has a dir added

From
FBFrodo Baggins <frodo.drogo@gmail.com>
Date
May 3, 2008, 13:51 UTC
Message-ID
<1cdff3fa0805030651j5d1936bdh4f7999163b7444ba@mail.gmail.com>

Hi, This is a newbie question.

I created a topic branch and made a few commits which added a few directories. I'd like to merge these changes back to master. I get the following error messages.

frodo@laptop-zion:~/src/c/logger$ ls
logger-inc  logger-src  Makefile  test-driver
frodo@laptop-zion:~/src/c/logger$ git branch
  debug-printf-help
  debug-static
  master
* split-into-dirs
frodo@laptop-zion:~/src/c/logger$ git checkout master
fatal: Entry 'logger-src/logger.cpp' would be overwritten by merge.
Cannot merge.

I think the above error is due to the fact that the branch master did not have these directories.

frodo@laptop-zion:~/src/c/logger$ git-ls-tree master
100644 blob 82ccb7971fc36db2bc54bb5a590f97cd37c998fb    .gitignore
100644 blob 9971a5a432d575cc682145454e5260f83e1b9fb3    Makefile
100644 blob b8f6c213ebb831ed8704b7f0e0e665212b808649    client.cpp
100644 blob d01aaec4138862ccae4be9de2c672ddaeccfa21d    logger.cpp
100644 blob 37c15a22b325934ea685a76cfd528c2bf6464f2b    logger.h
frodo@laptop-zion:~/src/c/logger$ git-ls-tree split-into-dirs
100644 blob 82ccb7971fc36db2bc54bb5a590f97cd37c998fb    .gitignore
100644 blob 7c497aff60175ce212415c1737e224f517f785e9    Makefile
040000 tree 4f181412688afaa30929b752cc1fb3f2cda3cba9    logger-inc
       <=== new dir
040000 tree 4fb363dac2a00d93d1a958f74021fcd0e3bc861e    logger-src
      <===
040000 tree bb2b91b6ec1d11d23ab8e7a3c8935504079f6bf3    test-driver         <===

Could someone help me out with this? frodo@laptop-zion:~/src/c/logger$ git --version git version 1.5.2.5

Regards, Frodo B

-- 
Never laugh at live dragons.
                              -- Bilbo Baggins
Next: Jeremy Ramer
Message 1 of 2 in “Trouble merging to master when topic branch has a dir added”
  1. Frodo BagginsMay 3, 2008
  2. Jeremy RamerMay 5, 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.