Code Monkey home page Code Monkey logo

Comments (7)

tierninho avatar tierninho commented on May 22, 2024 1

Site note: We should probably add the remove/uninstall cmd for MacOS to the ReadMe: https://github.com/github/gh-cli#macos

from cli.

tierninho avatar tierninho commented on May 22, 2024 1

Great, thank you!!!

from cli.

mislav avatar mislav commented on May 22, 2024

@tierninho Hmm, it seems like the github/gh Homebrew tap isn't auto-updating for you. The v6.6.6 release was an accident and we've reverted it last week. I rememeber you've had this trouble before, too: https://github.com/github/ce-cli/issues/10#issuecomment-539947533. Do you have any HOMEBREW_* environment variables set?

This should work in any case:

brew uninstall -f gh
brew update # typically not needed, Homebrew automatically runs this in 5-min intervals
brew install github/gh/gh

Note that even if you de-authorized "GitHub CLI" in your GitHub Settings, its oauth token is still stored in ~/.config/gh. CLI will attempt to use this (now invalid) token for API requests and fail. We don't yet handle this case, so you will have to manually remove ~/.config/gh too in order to re-authenticate. I will make a note for CLI to handle this better in the future.

# force re-auth
rm -f ~/.config/gh

Agreed re: remove/uninstall instructions!

from cli.

tierninho avatar tierninho commented on May 22, 2024

Thanks @mislav but still blocked. I tried without brew update but that ran into the download error above. With brew update is here:

➜  desktop git:(development) brew uninstall -f gh

➜  desktop git:(development) brew update
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Error: Fetching /usr/local/Homebrew/Library/Taps/github/homebrew-gh failed!
➜  desktop git:(development) ~/.gitconfig
zsh: permission denied: /Users/tierninho/.gitconfig
➜  desktop git:(development)

Let me know if you need to see output of brew doctor or brew config.

Do you have any HOMEBREW_* environment variables set?

I do not think so.

from cli.

mislav avatar mislav commented on May 22, 2024

It looks like Homebrew couldn't update the github/homebrew-gh tap due to not being able to fetch over SSH.

Do you normally use SSH git URLs with GitHub? If not, you can switch to HTTPS:

git --git-dir=/usr/local/Homebrew/Library/Taps/github/homebrew-gh/.git remote set-url https://github.com/github/homebrew-gh.git

HTTPS should have been the default; I'm not sure how it ended up being an SSH url for you.

from cli.

tierninho avatar tierninho commented on May 22, 2024

I swapped over to HTTPS, ran the cmd above and tried again but got the same result.

➜  desktop git:(development) brew install github/gh/gh
==> Installing gh from github/gh
==> Downloading https://github.com/github/homebrew-gh/releases/download/v6.6.6/gh_6.6.6_macOS_amd64.tar.gz
#=#=-#  #
curl: (22) The requested URL returned error: 404 Not Found
Error: An exception occurred within a child process:
  DownloadError: Failed to download resource "gh"
Download failed: https://github.com/github/homebrew-gh/releases/download/v6.6.6/gh_6.6.6_macOS_amd64.tar.gz

While brew update gave me:

➜  gh-cli git:(master) ✗ brew update
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Error: Fetching /usr/local/Homebrew/Library/Taps/github/homebrew-gh failed!

This was the output of the HTTPS cmd, not sure it worked based on:

➜  gh-cli git:(master) ✗ git --git-dir=/usr/local/Homebrew/Library/Taps/github/homebrew-gh/.git remote set-url https://github.com/github/homebrew-gh.git
usage: git remote set-url [--push] <name> <newurl> [<oldurl>]
   or: git remote set-url --add <name> <newurl>
   or: git remote set-url --delete <name> <url>
    --push                manipulate push URLs
    --add                 add URL
    --delete              delete URLs

from cli.

mislav avatar mislav commented on May 22, 2024

Ah sorry, I wrote you the wrong command to swap the remote url. This should do it:

git --git-dir=/usr/local/Homebrew/Library/Taps/github/homebrew-gh/.git remote set-url origin https://github.com/github/homebrew-gh.git

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.