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

query regarding git merge

From
RGrohit gupta <roborohitgupta75@gmail.com>
Date
Dec 13, 2015, 17:55 UTC
Message-ID
<loom.20151213T185500-631@post.gmane.org>

Hi, I am confused with git merge working.

Suppose I have these 3 files in master branch- a.txt b.txt d.txt

I create a branch, add c.txt to it and commit. So its final contents are- a.txt b.txt c.txt d.txt

Then, I checkout master branch, delete a.txt, add e.txt and commit. So final contents are- b.txt d.txt e.txt

Now when I merge branch in master, its result is- b.txt c.txt d.txt e.txt

Now suppose in branch, a.txt was needed for its working. And in master branch's latest commit a.txt was removed because maybe it wasn't needed or it was introducing bugs. Now, git merge removes that a.txt So now branch functionality wouldn't work. Isn't that wrong??

Next: brian m. carlson
Message 1 of 4 in “query regarding git merge”
  1. rohit guptaDec 13, 2015
  2. brian m. carlsonDec 13, 2015
  3. brian m. carlsonDec 13, 2015
  4. Jeff KingDec 14, 2015

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.