# git_ui: Create new worktree on latest origin main \(\#57704\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/b1bfde9e9dc6589dcd8510509c4a6f4298e80f3f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: b1bfde9e9dc6589dcd8510509c4a6f4298e80f3f

Requested commit: b1bfde9e9dc6589dcd8510509c4a6f4298e80f3f

Commit: b1bfde9e9dc6589dcd8510509c4a6f4298e80f3f

Tree: 8976ae8b18991e977affaece0e2fff1d1489fa2a

Author: Bennet Bo Fenner

Committer: GitHub

## Message

```
git_ui: Create new worktree on latest origin main (#57704)

When creating a git worktree, we now always fetch latest `origin/main`
and create the worktree based on that. If running `git fetch` fails, we
show an error toast with the option to base the worktree of off local
`origin/main`:

<img width="530" height="45" alt="image"
src="https://github.com/user-attachments/assets/f9ae4c05-8c2c-44f3-9c14-3c291a9d82f6"
/>


Release Notes:

- git: Always create worktrees based on latest `origin/main`
```

## Parents

- [e7bbfd5223034962438ad2c428ed063a54770d58](https://git.cafe/gitcafe/zed/commit/e7bbfd5223034962438ad2c428ed063a54770d58?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/b1bfde9e9dc6589dcd8510509c4a6f4298e80f3f?format=markdown)
