Skip to content

error reported when fetching origin/upstream that no longer exists #3715

Open

Description

@mark-friedman

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.)

Activity

  1. shiftkey commented on Jan 2, 2018

    @shiftkey
    Member

    @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
    
  2. mark-friedman commented on Jan 2, 2018

    @mark-friedman
    Author

    Thx, @shiftkey!

  3. added
    bug
    on Jan 3, 2018
  4. shiftkey commented on Jan 10, 2018

    @shiftkey
    Member

    I'm going to move this to enhancement for a couple of reasons:

    1. removing a remote requires some thought about how the app presents it to the user so that it's not overwhelming and terrifying
    2. its necessary to detect the difference between intermittent network issues and ongoing connectivity issues before the app thinks about removing a remote
    3. we're currently working on improving our forks and upstream experience as part of making PRs first-class in the app - Check out PRs from a fork #3602 is the last big feature to land - and once that's out in the wild we'll likely have feedback from users that overlaps with this issue
  5. added and removed
    bug
    on Jan 10, 2018
  6. mark-friedman commented on Jan 11, 2018

    @mark-friedman
    Author

    I would just point out that from the user point of view, this just seems like a bug. The fact that my branch's grandparent repo no longer exists shouldn't affect my ability to "Fetch origin". Maybe I don't understand what "Fetch origin" is supposed to mean. Could you explain what "Fetch origin" is trying to do beyond a straight git pull (which works just fine in this case)?

    Thanks in advance.

  7. shiftkey commented on Jan 11, 2018

    @shiftkey
    Member

    @mark-friedman "fetch origin" is how Git asks for new changes available on the remote repository, without changing the state of your current branch. The fetch button appears when you don't have changes to push or pull.

    Also, the error won't be displayed to the user when the app fetches in the background, and the user-initiated fetching will only try the "origin" repository (i.e. your fork) and "upstream" repository (the original repository). So if other remotes no longer exist, they won't be queried.

  8. changed the title [-]Can't pull latest from repo which was forked form a now deleted repo[/-] [+]error reported when fetching origin/upstream that no longer exists[/+] on Jan 11, 2018
  9. shiftkey commented on Jan 11, 2018

    @shiftkey
    Member

    Just updated the title to indicate this is related to fetch rather than pull

  10. mark-friedman commented on Jan 11, 2018

    @mark-friedman
    Author

    @shiftkey, From a semi-naive user's point of view I didn't really realize that the "Fetch origin" button was just doing a literal git fetch origin. What is seemed was going on when I clicked that button was that it synced my local branch with the GitHub repo (i.e. that it just did push/pull). Indeed, there are often some up/down arrow(s) on that button which seemed to imply that.

  11. Elderry commented on Oct 12, 2018

    @Elderry

    @shiftkey Your workaround will only work once, after relaunching Github Desktop, the upstream is back.

  12. shiftkey commented on Oct 12, 2018

    @shiftkey
    Member

    @Elderry can you please provide more details about what you are seeing? I'm not sure why Desktop would be re-adding the upstream, but maybe the log files and info about your repository will help here...

  13. Elderry commented on Oct 13, 2018

    @Elderry
    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.

  14. self-assigned this
    on Oct 13, 2018
  15. 6 remaining items

  16. steveward commented on Sep 14, 2021

    @steveward
    Contributor

    Reported in #12958.

  17. JamesCatt commented on Sep 15, 2021

    @JamesCatt

    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.

  18. alexmigf commented on Jan 9, 2023

    @alexmigf

    I'm having this error with pull origin as well, when are new changes in remote, Github performed actions for example. Doing it from the cli I don't have any errors and works as expected.

  19. steveward commented on Jul 27, 2023

    @steveward
    Contributor

    Reported in #17126.

  20. tidy-dev commented on Nov 22, 2023

    @tidy-dev
    Contributor

    Reported in #17758

  21. fedesentito commented on Dec 13, 2023

    @fedesentito

    Is the error still present?

  22. chao921125 commented on Jun 27, 2024

    @chao921125

    I also encountered the same problem. It seems to be an occasional phenomenon. The reason is not clear at the moment. You just need to delete the local project and clone it again.

  23. SoaibHaque commented on Jul 14, 2024

    @SoaibHaque

    I'm getting this same issue in linux I used every distro, each distro gives me the same error
    The repository does not seem to exist anymore

    Currently, I'm on

    OS: CachyOS Gnome (Arch linux)
    Github Desktop: 3.4.2_linux1-1

    So I tried finding some settings in github desktop, and then I found View > Toggle developer Tools

    And then I fetched one more time and I got this error

    image

    And I simply pasted the error message to chatGPT, and by following the instructions, the issue was resolved for this repo.

    Here are the instructions:

    Open the repo in the GitHub desktop Press the CTRL + ` shortcut to open the terminal for the current repo.

    I found two ways to do this. First, try this:

    git remote set-url origin https://your_username:[email protected]/{OrganisationName}/{RepoName}.git

    your_username: will be your github username, Mine is "SoaibHaque"
    your_pat: will be your github Personal Access Token, Refer this link or this link
    Replace {OrganisationName} with your organisation's name
    Replace {RepoName} with your repository name

    You can find them in the repo url
    image

    If this will solve your issue, that's good, but if not, then try these steps.

    git config --global user.name "your_username"
    git config --global user.email "[email protected]"
    git remote set-url origin https://your_username:[email protected]/{OrganisationName}/{RepoName}.git

    [email protected]: will be your github account email.

    After all of this, execute this last line
    git config --global --add safe.directory /path/to/your/repository

  24. jrshelby commented on Sep 4, 2024

    @jrshelby

    Hi folks,
    I am an educator who teaches students to use GitHub Desktop to sync their coding assignments for class, and we use GitHub Classroom to set up assignment repositories for students. Recently, GitHub Classroom changed how assignments work in such a way that this error is probably going to be much more common for educators and students using this combination of tools.

    GitHub Classroom now creates student repositories by forking a "starter code" repo. It is common for the students to not have direct access to this starter code repo (it is private and they do not have read permission on their accounts). This results in an error on every fetch for a student working with their own repository.

    The following is how I described this issue on the GitHub Educator forums:

    Currently, I am:

    Creating a private template repo with starter code.
    Creating a Classroom assignment, which makes a private copy of that template.
    Students accept the assignment and get their private fork of the copy.
    For individual assignments, everything is private here (both the template and student forks). Part of this is because I'd like to keep solutions as a branch within the template. Another is so that students are not confused by available repos - they only see their own repos in the class organization.

    The problem:
    We use GitHub Desktop to work with our repos. When GitHub classroom fetches changes, students are getting an error on every fetch that reads "the repository does not seem to exist anymore". On closer inspection, the fetch is working just fine, and if there are commits on their repo, they'll be able to pull them.

    We're getting the error because the fetch is trying to access both the student repo and the forked parent repo. The students cannot access the parent repo because it is private. Thus, an error every time they fetch.

    After some Googling, it sounds like

    It is standard behavior of GitHub Desktop to fetch the parent repo.
    It is impossible to remove the upstream parent.
    A bunch of posts about this issue on the GitHub Desktop forums suggest that is in non-ideal, but is probably a rare edge case for GitHub Desktop use. I wanted to highlight the issue here because the new behavior of GitHub Classroom makes this not an edge case anymore. Probably a lot of educators have a similar set up to myself.

    If anyone knows a workaround for this, I'd be interested! It's not the end of the world - the fetch still goes through - but I work with high school students and it'd be great to simplify this process.

  25. steveward commented on Oct 3, 2024

    @steveward
    Contributor

    Reported in #19346.

  26. EricCharnesky commented on Dec 13, 2024

    @EricCharnesky

    Another educator using GitHub classroom here, we're seeing this very frequently as well, although not for everyone which seems odd.

  27. mr-hare-cca commented on Apr 9, 2025

    @mr-hare-cca

    This still seems like an issue; has it been resolved yet?

    The best way I have found to fix it is to go into .git/config and change the upstream link to the correct repo link. For some reason the current upstream link is some made up link that doesn't exist.

  28. ADecametre commented on Sep 11, 2025

    @ADecametre

    Quick fix (it takes 15 seconds per repository)

    You can run this command after cloning a repository:

    cmd /c for /F "usebackq delims=" %A in (`git remote get-url origin`) do git remote set-url upstream %A

    It shows a warning after the first restart, but after clicking Ignore, that annoying error no longer appears.

    GitHub.Classrooms.Bug.Fix.mp4
  29. dcowell commented on Feb 10, 2026

    @dcowell

    This is also having a big impact on some of our students and really needs fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions