Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github app cant locate local repository #6230

Open
LLIaMaHa opened this issue Nov 18, 2018 · 12 comments
Open

Github app cant locate local repository #6230

LLIaMaHa opened this issue Nov 18, 2018 · 12 comments
Labels
bug Confirmed bugs or reports that are very likely to be bugs priority-3 Bugs that affect small number of users and/or relatively cosmetic in nature

Comments

@LLIaMaHa
Copy link

When i add a lot new files to local repo folder, i saw in GitHub app err "Cant find <repository name>", i point on it again with clicking on button "locate" and chosing folder, but app still showing me that error. When i look on logs i saw that :
"error: [ui] 'git status' emitted 35835948 bytes, which is beyond the supported threshold of 20000000 bytes"
Please make the error message in this case more informative and understandable to the user, cause i realy dnt understand why application missed local repo and cant find it, even if i locate folder again. "Cant find..." is wrong in that case, it's not saying user, what actually is wrong.
image

@shiftkey
Copy link
Member

@LLIaMaHa thanks for the report!

When i look on logs i saw that :
"error: [ui] 'git status' emitted 35835948 bytes, which is beyond the supported threshold of 20000000 bytes"

This was a change we made in #5053 to address a previous limitation with reading the status of a repository #2449 - previously it would error after encountering a git status output of 10MB or more.

With that change we can see how many bytes are available before we read it in. We set the limit to 20MB as that seemed like a reasonable upper bound at the time. It looks like your example repository is over 34MB of output from git status, which suggests thousands of untracked files and/or a missing .gitignore file in the repository.

As a workaround, if you make the first commit using the Git command line and then drag-and-drop the repository into the application again, that should get you back to a good place.

@shiftkey shiftkey added priority-3 Bugs that affect small number of users and/or relatively cosmetic in nature bug Confirmed bugs or reports that are very likely to be bugs labels Nov 23, 2018
@shiftkey
Copy link
Member

Marking this as a P3 bug because I think we can make this a friendlier experience than marking the repository as missing.

@ajayang
Copy link

ajayang commented Oct 10, 2019

I am facing the same issue today. this tool becomes useless when we are dealing with large repo's such as android source repo's. i am surprise to see that other clients like Gitbash GUI works fine with 30k plus detection with out any issue.

@weblaunch
Copy link

For anyone else like me who is unfamiliar with git command line, here's a reference for the suggested remedy above:

https://help.github.com/en/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line

This suggestion didn't work for me, simply getting the same log message:

'git status' emitted 21201088 bytes, which is beyond the supported threshold of 20000000 bytes

@thavus
Copy link

thavus commented Apr 29, 2020

So basically github is not a good place to do mobile/web/game development especially large scale applications. Why am I paying for this? scratches head

Why has this bug been open for several years??? wtf

@owlboy
Copy link

owlboy commented Jul 15, 2020

This continues to be an issue.

@fawazahmed0
Copy link

I faced this today

@SpicyMelonCrab
Copy link

Yep, still an issue. Absolutely ridiculous and completely unprofessional.

@sergiou87 sergiou87 added this to Triage in Desktop Housekeeping via automation Apr 12, 2021
@DanielBelmes
Copy link

Yea the UX here is frustrating. I was switching to an old branch with a lot of new untracked changes for that branch and github desktop just loses sight of my repository. I think the failure should really just report itself instead of closing out of the repository.

@MeltyPlayer
Copy link

MeltyPlayer commented Oct 23, 2023

Still running into this issue in 2023, I'm astonished that this has been a known issue since 2018.

Could you please consider reprioritizing this? Even if it only affects a small number of users, it completely breaks the program for us so it's fairly severe in nature.

At the very least, improving the error message so that it warns the user there are too many untracked files?

@Ocean-Odyssey
Copy link

whats the fix to deal with this?

@MeltyPlayer
Copy link

MeltyPlayer commented Oct 23, 2023

whats the fix to deal with this?

When this error occurs, the root cause is that there are too many untracked files in the GitHub repository for GitHub Desktop to handle. According to Google, an "untracked file" is a "file that is not currently managed by Git". My simple understanding is that these are unignored files that Git sees as as newly added and would appear in "Changes" with a + icon:
image

For more context, GitHub Desktop internally calls git status and tries to build up a buffer based on these files. If the buffer is more than ~20MB then it throws an error internally, breaking the flow of logic in the UI and resulting in this odd message "Can't find [repo name]". In other words, this error message is totally inaccurate--the issue isn't that the repo can't be found, it's that there are too many untracked files to handle in the UI.

The fix is to manually address the untracked files in your repo. You can get a sense of what's going on in your repo by manually calling git status from the CLI:
image

Here's some ways I can think of addressing the untracked files, i.e. the files that could be applicable to the next commit:

  • Creating or updating your .gitignore file to trim down the list of untracked files to just what is needed. This was the issue in my case--one of my commits changed the directory structure, resulting in an enormous number of previously ignored files suddenly being considered as changes.
  • Deleting all of the untracked files, either manually, by recloning from scratch, or calling git clean -dfx via the CL according to this StackOverflow answer. This was the suggestion I gave to other folks who had cloned my repo and were experiencing the same issue as me. Word of warning, make sure that you're okay with permanently deleting these first!
  • If the files are intended to be included in your repo, I think it should still be possible to manually push the changes via the CLI? I'm kind of an idiot when it comes to the command line, hence why I prefer using GitHub Desktop, but it sounds like you should be able to do this via git add --all, git commit -m "My commit message", and then git push -u origin HEAD.

Once the untracked files have been addressed, GitHub Desktop should work again.

Hopefully this helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed bugs or reports that are very likely to be bugs priority-3 Bugs that affect small number of users and/or relatively cosmetic in nature
Projects
Development

No branches or pull requests