forgit icon indicating copy to clipboard operation
forgit copied to clipboard

Feature Request: Add git worktree switcher like gcb

Open deekshithanand opened this issue 1 year ago • 3 comments

Check list

  • [x] I have read through the README
  • [x] I have the latest version of forgit
  • [x] I have searched through the existing issues

Environment info

  • OS
    • [ ] Linux
    • [x] Mac OS X
    • [ ] Windows
    • [ ] Others:
  • Shell
    • [ ] bash
    • [x] zsh
    • [ ] fish

Feature Request:

Add a work tree switcher like gcb , leveraging fzf.

deekshithanand avatar Sep 16 '24 10:09 deekshithanand

Thanks for your idea. I am not sure how the interface is supposed to look like. In forgit we only have wrappers for existing git functionality up to now, and there is no git worktree switch command or anything similar. Can you describe how your usecase looks like and what exactly you would like to achieve? Is it only about cding into a different work tree?

carlfriedrich avatar Sep 16 '24 10:09 carlfriedrich

@deekshithanand what do you think of the following abbreviations?

All Possible Worktree Operations (https://git-scm.com/docs/git-worktree):

  • git worktree add
  • git worktree list
    • cd + interactive as gwj (git worktree jump - not a native git operation)
  • git worktree lock
    • interactive as gwl
  • git worktree move
  • git worktree prune
  • git worktree remove
    • interactive as gwr
  • git worktree repair
  • git worktree unlock
    • interactive as gwu

I have only implemented gwj, gwl, gwr, and gwu in #402.

suft avatar Nov 05 '24 01:11 suft

Awesome!

deekshithanand avatar Mar 31 '25 13:03 deekshithanand

Right now gcb shows worktrees, but fails to switch to them

Image

iloveitaly avatar Aug 20 '25 15:08 iloveitaly

@iloveitaly Can you post a screenshot of what you get when you run git worktree list in the same repo as the gif above?

suft avatar Aug 22 '25 19:08 suft

Image

gcb still give me the worktrees in the list

Image

iloveitaly avatar Nov 18 '25 18:11 iloveitaly