libgit2 / libgit2/libgit2

Is there a config for worktree?

Open
#5,442 3 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
10.6k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

❯ git config -h
usage: git config [<options>]

Config file location
    --global              use global config file
    --system              use system config file
    --local               use repository config file
    --worktree            use per-worktree config file
    -f, --file <file>     use given config file
    --blob <blob-id>      read config from given blob object

The git command line have a config file for the worktree mode, and have a extensions.worktreeConfig to enable it.

I found that the git_repository_config could not read the config file.

Now, I must get the .git/worktrees/xxx/config.worktree path, and add the config file into the git_config.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing git_repository_config and git_config to see how repository configuration is discovered and loaded. Check how Git's --worktree mode and extensions.worktreeConfig affect the config path; done means worktree configuration is available through the repository configuration API without callers assembling the path themselves.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, git
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.