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

Re: Merging problem

From
Sergey Organov <sorganov@gmail.com>
Date
Aug 2, 2024, 20:53 UTC
Message-ID
<87o76alk7v.fsf@osv.gnss.ru>
In-Reply-To
<3db395fe-8d32-4a33-8f16-7df95f3ff194@pathcom.com>
Michael Salman <mjsalman@pathcom.com> writes:
Show 16 quoted lines
> I am new to using git and I encountered the following problem
>
> 1) Created a repository using Notepad added a file (FileA.txt). Put one line of text in the file. Did a git commit -a. so far so good.
>
> 2) I created a branch (my-branch), did a git checkout my-branch
>
> 3) Using notepad loaded FileA and changed the first line of text to something else. Gave command git commit -a no problems
>
> 4) Git checkout master looked at FileA nothing changed
>
> 5) Did a git merge my-branch. No conflict reported
>
> 6) Loaded FileA in master the text of the first line had changed to what is in FileA from the branch
>
> Your help with this problem would be appreciated. I hope this is not
> due to my lack of understanding

You didn't tell us what outcome you expected, but to me all looks fine: you've merged your changes (made at step 3) from side branch to the master branch, and now your changes (made at step 3) are there on the master branch as well: that's the whole purpose of merges.

As there were no any changes on master, there is nothing there for a potential conflict, so all went pretty smooth, as expected. If you change first line of the file in notepad (differently from step 3) between steps 4 and 5 as well, and commit your changes, you will then get conflict during merge.

-- Sergey Organov
Previous: rsbecker@nexbridge.com
Message 4 of 4 in “Merging problem”
  1. Michael SalmanAug 2, 2024
  2. brian m. carlsonAug 2, 2024
  3. rsbecker@nexbridge.comAug 2, 2024
  4. Sergey OrganovAug 2, 2024

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.