Simple search terms return no results within repo files

I’ve been trying to find all files in the repo of my website, that contain a certain string. However, searching for that string either within quotes or without them, returns no results, even though the term does appear in several files within the repo.

I don’t even mean complex search terms or regexp etc, but simply single words, at the most containing some punctuation. For instance, searching for “pictureName.jpg” to see which markdown file in a website repo loads that picture, returns no result, neither does searching merely “pictureName”.

The Searching For Code part of the documentation didn’t really answer this for me.

EDIT: my bad, I had missed the part about forked repos (which is what mine is) not being indexed for searches, even with flags like fork:true. Still, I wonder if there is any other way of searching for a given term to find which of my repo’s files contains it? Perhaps if I use Github from the local client, instead of through the github.com interface? It just seems that it’s not really helpful to even fork a repo for yourself, if you are then unable to work with it (meaning also: search through it!)?!

Hello @wildetudor :wave:

Thanks for sharing your feedback about this feature. I suggest cloning your repository and searching within your chosen editor. The only way a fork will surface any results is if it has more stars than the parent.

A question for you. Why is a fork being used in this case rather than a clone of the parent repository? Are you contributing to the parent repository?

Thanks for your reply! I just wanted to create a personal website based on that template. Thus, I should have probably cloned rather than forked the repository, I just wasn’t aware of the difference at the time. Since I now customised my website contents, would I need to clone that repo in order to make it searchable? If so, can I do this (and consequently use the search function) all within Github.com ? Or would I have to do it using the desktop Github client?

Thanks for that additional context!

I have a few options for you here.

  • Detach your fork from the parent repository. Therefore making yours a standalone repository.
  • Clone your current fork. Configure it to work with your site. Delete your fork.
  • You can use git grep command to find lines matching a pattern in the command line.

Detaching the fork will require our direct support team to do that for you. If you choose this route, I can escalate this issue to them on your behalf.

Yes please, let us do that, if I understand correctly that this will make my then-standalone repository searchable directly on github.com, without necessitating the desktop version. Please do let me know what changes I need to make in order for the site to keep working the same way.

One more question: when I navigate to tudorpopescu dot com and click on one of the links (e.g. “Publications”), the URL changes to the github URL (https://wildetudor.github.io/publications/). What setting do I need in order for the base URL to stay my custom URL?

Thanks again for your help!

I will need the link to your repository in order to get you going with detaching it.

You will need to setup a custom domain in order to link to your unique domain. Take a look at the Managing a custom domain help doc.

Thanks! My repo: https://github.com/wildetudor/wildetudor.github.io

In the help doc you linked, I got stuck at step 4: my DNS provider is Netlify, as I had first created my site using this guide and GH fork; I’ve kept the Netlify connection even though I later used a different site template (the one I forked from). And in the Netlify DNS settings I cannot find any place to create a CNAME record. Can I just altogether eliminate the intermediary step of my site going through netlify, and just use GH Pages?

Also, my adding of the custom domain name seems to have broken something, as my site now loads as “plain text”, which means I guess that the CSS styles are not accessible! This was easily undone by removing the custom domain name from the repo Settings.

I initiated the request to detach your fork. In order to keep this focused on your original question can you create a post about your custom domain on the Pages portion of the forum?

1 Like

Thank you, I did this, new thread is here Custom URL disappears when clicking on pages

1 Like

hey Ernest, I see my repo is now searchable, so I assume it’s been dettached, although I was wondering what this implies to be different. The settings/homepage of the repo still look the same, so is it the case that all that’s changed is under the hood, and I need make no other changes to the settings?

(no luck yet with my other question of whether this repo is GitHub Pages, or just GitHub…)

One more question: since my repo is now dettached, I see I can also make it private, which I’d prefer. However, GH warns that doing this will make me lose access to all pages published from it. How else can I make it private? Thanks!

Hi Ernest, I was wondering if you have any thoughts about the points I raised - many thanks again for your help.