Skip to content

Support Git Worktree and Bare Repos #320

@bartdorsey

Description

@bartdorsey

🚀 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>

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions