Skip to content

gh auth setup-git gives no feedback #11191

Open

Description

@adamchainz

Describe the bug

Running gh auth setup-git gives no output even though it successfully edits the Git configuration.

Affected version

gh version 2.74.2 (2025-06-17)

Steps to reproduce the behavior

  1. gh auth setup-git
  2. No output
  3. Git configuration (~/.config/git/config or ~/.gitconfig) updated successfully though:
    [credential "https://github.com"]
      helper =
      helper = !/opt/homebrew/bin/gh auth git-credential
    [credential "https://gist.github.com"]
      helper =
      helper = !/opt/homebrew/bin/gh auth git-credential

Expected vs actual behavior

Output that explains which Git settings have been configured.

Logs

$ gh auth setup-git

Activity

  1. added
    bug
    on Jul 1, 2025
  2. added
    needs-triage
    on Jul 1, 2025
  3. cadillacwigfall21 commented on Jul 1, 2025

    @cadillacwigfall21
  4. added
    enhancement
    gh-auth
    and removed
    bug
    on Jul 1, 2025
  5. babakks commented on Jul 2, 2025

    @babakks
    Member

    Hi @adamchainz, and thanks for creating the issue. 🙏

    May I ask what do you expect to see as output? Can you give me an example?

  6. added
    more-info-needed
    and removed
    needs-triage
    on Jul 2, 2025
  7. adamchainz commented on Jul 2, 2025

    @adamchainz
    Author

    Maybe:

    Updating global Git configuration
    ✔️ Added credential entry for https://github.com
    ✔️ Added credential entry for https://gist.github.com
    

    But even a simple one-liner "✔️ Updated Git configuration" would be fine!

  8. babakks commented on Jul 4, 2025

    @babakks
    Member

    Nice suggestion, @adamchainz! 👍

    As a bit of context, the idiomatic way to indicate a successful action is a zero exit-code, which you can check by running echo $? right after running a gh command. Ideally, nothing trivial/verbose should be printed to stdout/stderr. However, this is not a rule set in stone and good number of gh commands do not apply it.

    So, I'm not a fan of a trivial message like the second example you provided, but the first example is a nice experience and makes sense to me, since it shows the affected git configuration sections and could provide a some insight to the user.

    As a side note, since the auth setup-git had no successful-mode output so far, it wouldn't be a breaking change. So, I'm going to comment the A/C

  9. babakks commented on Jul 4, 2025

    @babakks
    Member

    Acceptance Criteria

    Given I have already logged in on one or more hosts and
    Given I have an interactive terminal (tty)
    When I run gh auth setup-git
    Then I see an output indicating the affected changes; e.g.

    ✓ Added credentials for https://github.com
    ✓ Added credentials for https://gist.github.com
    

    Given I have already logged in on one or more hosts and
    Given I have an non-interactive terminal (non-tty)
    When I run gh auth setup-git
    Then I see no output (no changes in behavior)

  10. added
    core
    and removed
    more-info-needed
    on Jul 4, 2025
  11. BagToad commented on Jul 8, 2025

    @BagToad
    Member

    As a side note, since the auth setup-git had no successful-mode output so far, it wouldn't be a breaking change. So, I'm going to comment the A/C

    @babakks and I discussed this and decided that changing the output for non-interactive would actually be a breaking change. So, we updated the AC to only change interactive output.

  12. adamchainz commented on Jul 8, 2025

    @adamchainz
    Author

    Totally fair!

  13. Heapnotizer commented on Jul 27, 2025

    @Heapnotizer

    Hi @babakks @BagToad , is this issue free to work on?

  14. babakks commented on Aug 1, 2025

    @babakks
    Member

    @RAZOR099 Thanks for your interest! 🍻 We still need to discuss this internally and decide if this is something we would want to stamp a help wanted Contributions welcome on it. I'll now remove the core This issue is not accepting PRs from outside contributors label so that we'll pick it up for internal discussion.

  15. removed
    core
    on Aug 1, 2025
  16. self-assigned this
    on Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementgh-auth

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions