Skip to content

"gh repo set-default" in a bare repo "must be run from inside a git repository"? #6860

@dbarnett

Description

@dbarnett

Describe the bug

Trying to get gh working in a bare repo, I'm getting "No default remote repository" from commands like gh repo view but then running gh repo set-default just gives me an error "must be run from inside a git repository.

More details in jj-vcs/jj#1008 (comment).

gh version 2.21.2 (2023-01-03)

Steps to reproduce the behavior

  1. git clone --bare https://github.com/cli/cli.git
  2. cd cli.git
  3. gh repo set-default

Expected vs actual behavior

Expected: allow setting default repo or give some other useful output

Actual: Just a vague (and wrong?) failure message must be run from inside a git repository

Logs

dbarnett@penguin                                             Sat 14 Jan 2023 09:18:14 AM CST
~/projects$ git clone --bare https://github.com/cli/cli.git
Cloning into bare repository 'cli.git'...
remote: Enumerating objects: 43602, done.
remote: Counting objects: 100% (252/252), done.
remote: Compressing objects: 100% (130/130), done.
Receiving objects: 100% (43602/43602), 26.50 MiB | 3.67 MiB/s, done.
remote: Total 43602 (delta 146), reused 208 (delta 122), pack-reused 43350
Resolving deltas: 100% (29478/29478), done.
dbarnett@penguin                                             Sat 14 Jan 2023 09:18:47 AM CST
~/projects$ cd cli.git/
dbarnett@penguin                                             Sat 14 Jan 2023 09:18:51 AM CST
~/projects/cli.git$ gh repo set-default
must be run from inside a git repository

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingp3Affects a small number of users or is largely cosmetic

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions