Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for git worktrees when checking out #544

Open
BChausse-GoTo opened this issue Mar 5, 2025 · 0 comments
Open

Support for git worktrees when checking out #544

BChausse-GoTo opened this issue Mar 5, 2025 · 0 comments

Comments

@BChausse-GoTo
Copy link

Some context:
Using git worktrees is growing in popularity since it allows one to checkout multiple branches at once (which avoid having to stash changes when working on multiple branches/PRs at once). This is an example of how I (and I believe, many others) manage their git repositories:

./development-dir/my-first-repo/main
./development-dir/my-first-repo/feat-a-branch
./development-dir/my-first-repo/feat-b-branch
./development-dir/my-second-repo/main
./development-dir/my-second-repo/feat-a-branch
./development-dir/my-second-repo/feat-b-branch

If someone asks me to review changes and/or test something in their PR branch.
I don't have to stash my changes and can work on both in parallel.

The issue:
The current implementation for repoPaths in the config.yml to checkout PRs is quite one-dimensional doesn't account for it. If a worktree already exists for the branch to checkout, gh-dash responds with exit status 1 when it could simply point to the existing worktree directory. Also there is no way to configure gh-dash to create worktrees.

Feature request:
I would love a way to be able to manage PRs using git worktrees fro the gh-dash UI.
Here is a simple way I think this could be achieved using a double asterisk notation:

repoPaths: {
  ChausseBenjamin/*/*: ~/dev-dir/*/* # Use worktrees for every repo from that user/org
  torvalds/linux/*/*: ~/dev-dir/*/* # Use worktrees for this specific repository  
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant