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 Git Worktree and Bare Repos #320

Open
bartdorsey opened this issue Mar 28, 2023 · 0 comments
Open

Support Git Worktree and Bare Repos #320

bartdorsey opened this issue Mar 28, 2023 · 0 comments

Comments

@bartdorsey
Copy link

🚀 Feature Proposal

Support adding projects as git worktrees and bare repositories.

Motivation

I like to keep my repositories checked out as git worktrees. Here's the common patterns I've seen people use

  1. Checkout the main branch into <project_folder/main> and then use git worktree ../branch_name branch_name from inside main to check out other branch names
  2. Checkout the repository as a bare repo, and checkout worktrees as subfolders of the bare repo.
  3. Checkout the repository as a bare repo into a <project_dir>/.bare folder, and create worktrees inside the project folder.

We can have a discussion about which of these are the right approach, or if the meta tool should support all of these. But I'd be willing to adapt my workflow to which ever one meta adopts.

Example

git import --worktree --branches main, development <destFolder> [<childRepoUrl>]

Would result in a normal repo being cloned into <destFolder>/main (the first branch listed) and the remaining branches being added as git worktrees inside <destFolder>

git import --worktree --bare --branches main, development <destFolder> [<childRepoUrl>]

Would result in a bare repo being cloned into <destFolder> and the main and development branches being checked out as worktree folders inside <destFolder>

git import --worktree --bare --hidden --branches main, development <destFolder> [<childRepoUrl>]

Would result in a bare repo being checked out into <destFolder>/.bare and then the main and development branches being checked out as worktree folders inside <destFolder>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant