desktop: error reported when fetching origin/upstream that no longer exists

Description

Clicking “Fetch origin” on a branch of a repo which was forked from a now deleted repo yields an error.

Version

GitHub Desktop version: 1.0.12-beta0

OS version: macOS 10.13.2

Steps to Reproduce

  1. Switch to the repo
  2. Select the master branch
  3. Click on “Fetch origin”

screen shot 2018-01-02 at 1 08 12 pm

Expected behavior: The current version of the repo gets pulled

Actual behavior: An error is generated

Reproduces how often: 100%

Logs

2017-07-31.desktop.production.log

Additional Information

From the console log of GitHub Desktop app (private information replace by '*'s). Note that the git URL in the error message is for the repo that my repo was forked from and no longer exists:

git -c credential.helper= fetch --progress --prune upstream exited with an unexpected code: 128. remote: Repository not found. fatal: repository ‘https://github.com/********/*****************.git/’ not found

(The error was parsed as 8: The repository does not seem to exist anymore. You may not have access, or it may have been deleted or renamed.)

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 18 (10 by maintainers)

Most upvoted comments

Switching this over to bug because it looks like Desktop might be meddling in the process by re-adding the upstream repository.

@shiftkey I think that’s really the big issue here. Having the upstream be inaccessible for whatever reason is a bit of an edge case, and can easily be worked around by removing it via command line—except that Desktop keeps re-adding it.

In my case I ran into this because the upstream repo was actually deleted and now I have to go through this workaround every time I launch Desktop.

  1. In Github Desktop, choose a repo whose fork parent no longer exists.
  2. Click Fetch origin, then an error message pops, claim that The repository does not seem to exist anymore.
  3. Close the message, open command line in this repo. (Ctrl + `)
  4. Input git remote remove upstream
  5. Click Fetch origin again, this time it succeeded.
  6. Close Github Desktop, then open.
  7. Click Fetch origin the 3rd time, this time the error message pops again.

@shiftkey Hope this helps.

@mark-friedman thanks for the details!

As a workaround, you can open the repository in a shell and run this command to stop tracking the now-missing remote repository:

$ git remote remove upstream