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

How to specify a remote branch in git worktree?

From
EOElie Obeid <elieobeid7@gmail.com>
Date
Jul 25, 2022, 20:51 UTC
Message-ID
<CAFWJc9_QM1CQ69yXCOHTi4KSZJffhty5s=egUUx-6RTjUVF9+w@mail.gmail.com>

Hi, I have two remote branches prod and beta, I want to create one worktree for prod and one for beta.

mkdir app && cd app git clone --bare repo .git git worktree add --checkout beta beta git worktree add --checkout prod prod cd prod git pull Mege conflict

As you can see, I get a merge conflict right after I clone the repo, create the worktree and do a git pull, maybe the worktree is trying to do a pull from master, I have no idea How to fix that?

Best Regards.
Next: Elie Obeid
Message 1 of 2 in “How to specify a remote branch in git worktree?”
  1. Elie ObeidJul 25, 2022
  2. Elie ObeidJul 25, 2022

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.