cli / cli/cli

gh "base repository" not worktree specific

Open
#1,837 6 comments 1 reaction 0 assignees View on GitHub
core enhancement
Dominant language
Go
Stars
46.3k
Forks
9k
Avg merge
2d 9h
Merged PRs (30d)
89

Description

gh version 1.0.0 (2020-09-16)

Setup: a "bare" git repository with multiple remotes and multiple git worktrees. For example: both https://github.com/llvm/llvm-project and https://github.com/apple/llvm-project

Problem: Unlike similar git workflows, `gh` asks the user to pick a "base repository" which is tied to the bare repository, not branches nor worktrees.

Workaround: create a wrapper around `gh` that tries to set `GH_REPO` as needed. In short, the script will extract the GitHub URL from git and pass it to gh: `git config remote.$(git config branch.$(git branch --show-current).remote).url`

Finally, and unless I missed something, the "base repository" feature seems undocumented.

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.