devcontainers / devcontainers/cli

git worktree support

Open
#796 16 comments 59 reactions 1 assignee Claimed by @chrmarti View on GitHub
feature-request
Dominant language
TypeScript
Stars
3k
Forks
457
Avg merge
13h 17m
Merged PRs (30d)
6

Description

If you try to open a project with a devcontainer that is actually a worktree, the started container does not work as expected.
In a worktree, `.git` is not a directory, but a file containing:

```
gitdir: /hostpath/to/real/git
```

If the container uses git commands, all those will fail with different error messages. Commits will not work, submodules will fail among other things.

## fixes
What could possible work is to read the gitdir value and add this directory as volume to the same name as specified in the `.git` file.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.