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

Re: Strange branch merging.

From
Sitaram Chamarty <sitaramc@gmail.com>
Date
Feb 12, 2009, 13:08 UTC
Message-ID
<slrngp87pn.50p.sitaramc@sitaramc.homelinux.net>
In-Reply-To
<49940D93.6000204@movency.com>
On 2009-02-12, Adam Panayis <adam@movency.com> wrote:
Show 16 quoted lines
> I have a local machine, on this I have 2 branches. The master and one 
> named blah. My git repository is in the following location: /git/.git/
>
> I have made changes to a file on the blah branch and committed these 
> changes.
>
> I checkout the master branch and as expected the changes are no longer 
> there. I flip back to blah and I can see my changes. So far so good.
>
> I then, on a remote machine use the pull command, the remote machine 
> shows only the master branch as I have not asked it to pull blah. The 
> command I use is as follows: git pull -v ssh://user@machine one/git/.git/
>
> Once this is done I double check my branches and it shows I still only 
> have the master. Perfect. However, when I check the file I edited on my 
> local machine on the blah branch, the changes are there.

On the remote machine, your current branch was 'master'. When you did a 'git pull', whatever you did would affect this branch. Meanwhile, the currently checked-out branch on the other side was 'blah', which is what came in.

What you need to do is add the word 'master' to the 'git pull...' command you used. This will ensure that, regardless of what the currently checkedout branch on the sending side is, you will get the master branch.

Previous: Adam Panayis
Message 6 of 6 in “Strange branch merging.”
  1. Adam PanayisFeb 12, 2009
  2. Pieter de BieFeb 12, 2009
  3. Adam PanayisFeb 12, 2009
  4. Pieter de BieFeb 12, 2009
  5. Adam PanayisFeb 12, 2009
  6. Sitaram ChamartyFeb 12, 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.