Skip to content
This repository was archived by the owner on Oct 27, 2025. It is now read-only.
This repository was archived by the owner on Oct 27, 2025. It is now read-only.

using-git-worktrees: support bare git repos #17

@b0o

Description

@b0o

I usually work in bare git repos (git init --bare/git clone --bare) and keep my worktrees in the worktree/ directory. This way, there's no need for .gitignore files, and it feels cleaner as opposed to having a worktrees/ directory nestled inside of my project. Here's an example of what it looks like:

~/test/git-worktree/bare/
├── hooks/
├── info/
├── logs/
├── objects/
├── refs/
├── rr-cache/
├── worktree/          # this is where I keep the actual worktrees that I cd into
│   ├── main/          # main branch
│   │   ├── .git
│   │   └── README.md
│   ├── foo/           # foo branch
│   │   ├── .git
│   │   ├── foo/
│   │   └── README.md
│   └── bar/           # bar branch
│       ├── .git
│       └── README.md
├── worktrees/         # this is where git keeps its metadata for the worktrees (that's why I name my worktree directory "worktree" and not "worktrees")
│   ├── main/
│   │   ├── logs/
│   │   ├── refs/
│   │   ├── COMMIT_EDITMSG
│   │   ├── commondir
│   │   ├── gitdir
│   │   ├── HEAD
│   │   ├── index
│   │   └── ORIG_HEAD
│   ├── foo/
│   │   ├── logs/
│   │   ├── refs/
│   │   ├── AUTO_MERGE
│   │   ├── commondir
│   │   ├── gitdir
│   │   ├── HEAD
│   │   ├── index
│   │   └── ORIG_HEAD
│   └── bar/
│       ├── logs/
│       ├── refs/
│       ├── AUTO_MERGE
│       ├── commondir
│       ├── gitdir
│       ├── HEAD
│       ├── index
│       └── ORIG_HEAD
├── config
├── description
└── HEAD

It would be nice if this was supported by the using-git-worktrees. For now, I'm maintaining a fork of this repo with that skill modified to suit my needs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions