# How to specify a remote branch in git worktree?

2 messages from 2022-07-25 to 2022-07-25. Participants: Elie Obeid.
Thread: https://gitlist.dev/t/58221

## Elie Obeid, 2022-07-25 20:51

Subject: How to specify a remote branch in git worktree?
Message-ID: <CAFWJc9_QM1CQ69yXCOHTi4KSZJffhty5s=egUUx-6RTjUVF9+w@mail.gmail.com>
URL: https://gitlist.dev/e/CAFWJc9_QM1CQ69yXCOHTi4KSZJffhty5s%3DegUUx-6RTjUVF9%2Bw%40mail.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.

```

## Elie Obeid, 2022-07-25 21:07

Subject: Re: How to specify a remote branch in git worktree?
Message-ID: <CAFWJc98dciS9wZ359PJjMeNhiG_+xy2otkz4a79MoPCRK-Mxew@mail.gmail.com>
URL: https://gitlist.dev/e/CAFWJc98dciS9wZ359PJjMeNhiG_%2Bxy2otkz4a79MoPCRK-Mxew%40mail.gmail.com
In-Reply-To: <CAFWJc9_QM1CQ69yXCOHTi4KSZJffhty5s=egUUx-6RTjUVF9+w@mail.gmail.com>

```
The regular clone (without using --bare), works excellently, with no
issues, I just tested it,
added workspaces and all is fine.

Best Regards.


On Tue, Jul 26, 2022 at 12:51 AM Elie Obeid <elieobeid7@gmail.com> wrote:
>
> 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.

```
