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

question about a merge result

From
FMFrancis Moreau <francis.moro@gmail.com>
Date
Apr 30, 2009, 12:21 UTC
Message-ID
<38b2ab8a0904300521m9e31867j7848135acfae0faa@mail.gmail.com>
Hello,

I'm a little bit confused about a merge I have done and the result suprised me. Thinking about it I'm still not convinced what should be the result.

Here's the use case:

$ mkdir test-git && cd test-git $ date > A $ date > B $ git init $ git add . $ git commit -m "Init"

So far I just created a repo with 2 files A and B

$ git branch b1 $ git rm B $ git commit -m "remove B"

Now I created a branch 'b1' and remove B file in master branch

$ git checkout b1 $ git rm B $ git commit -m "remove B" $ git revert HEAD

Now on 'b1' I did the same as master but I thought that removing B was a bad idea so I revert the previous commit

$ git checkout master $ git pull . b1 $ ls B ls: cannot access B: No such file or directory

So merging 'b1' into master removed the B file even if in branch 'b1' I restored it.

Could anybody explain me why this is the correct behaviour and why not file 'B' is not restored as it was done in branch 'b1' ?

thanks
-- 
Francis
Next: Michael Gaber
Message 1 of 7 in “question about a merge result”
  1. Francis MoreauApr 30, 2009
  2. Michael GaberApr 30, 2009
  3. Jeff KingApr 30, 2009
  4. Francis MoreauApr 30, 2009
  5. Björn SteinbrinkApr 30, 2009
  6. Jeff KingApr 30, 2009
  7. Daniel BarkalowMay 1, 2009

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.