lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Worktree integration

Open abenz1267 opened this issue 4 years ago • 9 comments

Hello,

right now checking out branches that are present as worktrees doesn't work, as you get "fatal: branch is alreadt checked out at .."

Not sure if it's doable or even makes sense, but a simple cwd change would be the expected behaviour i guess.

Also opening up lazygit in the bare repo doesn't recognize the folder as a bare repo and wants to init git first, which ofc isn't want you want.

Ideas? Would this be within the scope of Lazygit?

Regards

abenz1267 avatar Apr 17 '21 11:04 abenz1267

I too would like to see this feature :+1:

parnmatt avatar Apr 25 '21 21:04 parnmatt

This would be very useful Getting the following error ".git not a directory". Since .git does not exist in the subdirectories added via "git worktree add"

jmauriciosalasmoreno avatar Aug 22 '21 01:08 jmauriciosalasmoreno

Since .git does not exist in the subdirectories added via "git worktree add"

It does create a .git; however, it is not a directory, it is a file containing something like:

gitdir: <PATH_TO_BARE_REPO>.git/worktrees/<WORKTREE_NAME>

this can therefore be used by Lazy git to point to the relevant git directory

parnmatt avatar Aug 22 '21 12:08 parnmatt

this would be great feature to have

KunaPrime avatar Oct 18 '21 08:10 KunaPrime

I haven't though through how we would implement this feature but I'm certainly on board for it. Happy to accept a PR

jesseduffield avatar Oct 18 '21 22:10 jesseduffield

I would love to have this feature implemented ! I'm still using stashes or wip commits to be able to checkout to another branch and it's quite painful

williamgoulois avatar Nov 28 '21 18:11 williamgoulois

I'm sorry, but is that a GUI for lazygit or...?

mark2185 avatar Sep 07 '22 07:09 mark2185

I got a little too excited and confused there! Nope it was for gitfork! Sorry!

On Wed, 7 Sept 2022 at 08:39, Luka Markušić @.***> wrote:

I'm sorry, but is that a GUI for lazygit or...?

— Reply to this email directly, view it on GitHub https://github.com/jesseduffield/lazygit/issues/1280#issuecomment-1239024072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6XBOMBZLY4QPMOLI53RJLV5BBC7ANCNFSM43C7QTHA . You are receiving this because you commented.Message ID: @.***>

TheDevelolper avatar Sep 07 '22 08:09 TheDevelolper

... can therefore be used by Lazy git to point to the relevant git directory (comment)

this is working well for me - think I misunderstood the context of the issue 👍

ptim avatar Feb 07 '23 02:02 ptim

Worktree support is on the way: https://github.com/jesseduffield/lazygit/pull/2147

If you would like to shape the UX check out the discussion here: https://github.com/jesseduffield/lazygit/discussions/2803

jesseduffield avatar Jul 24 '23 11:07 jesseduffield

Worktree support is on the way: #2147

If you would like to shape the UX check out the discussion here: #2803

This functionality is very exciting. Do we have a tentative schedule for the next release?

JakeTompkins avatar Aug 01 '23 20:08 JakeTompkins

It's not far off, I think it'll be in the next couple days. I just want to spend a bit more time with it to catch intermittent UI bugs (e.g. https://github.com/jesseduffield/lazygit/pull/2863)

jesseduffield avatar Aug 01 '23 21:08 jesseduffield

It's not far off, I think it'll be in the next couple days. I just want to spend a bit more time with it to catch intermittent UI bugs (e.g. #2863)

Awesome!

JakeTompkins avatar Aug 02 '23 17:08 JakeTompkins

That's amazing it's on the way soon! I was just watching this video https://m.youtube.com/watch?v=IK_mjDqGUYE about Git Worktrees and came straight here and it sounds so useful 😁

jackoconnordev avatar Aug 18 '23 18:08 jackoconnordev

This has now been released so I'm closing this issue off :)

jesseduffield avatar Aug 19 '23 00:08 jesseduffield