Skip to content

Add support for GIT_COMMON_DIR environment variable #1860

@jelmer

Description

@jelmer

Description

Add support for the GIT_COMMON_DIR environment variable, which allows Git to use a separate git directory and work tree.

Background

The GIT_COMMON_DIR environment variable specifies the path to the git directory when it's separate from the working tree. This is particularly useful for:

  • Git worktrees where multiple working directories share the same git objects
  • Custom repository layouts where the .git directory is not in the working tree root

Use Case in Dulwich

This would be valuable for Dulwich users who:

  • Work with multiple worktrees
  • Have custom repository setups with separate git directories
  • Need to interact with repositories that use this Git feature

Implementation Notes

This would require updating repository discovery and initialization code to respect the GIT_COMMON_DIR environment variable when locating git objects and references.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions