Edit:

Since theres been some confusion with dates

In 2016 github made site side searching login only and hid the search bar if you werent logged in. This didnt include searching within a repository so that could still be done, just not all repositories

This year was the change being referred to in this link which made repository level searching require logging in

Blog post: https://github.blog/changelog/2023-06-07-code-search-now-requires-login/

    • MajorHavoc@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      This is news to me. I’ve been cloning and searching for years because web search was useless. And by useless I mean - I know the word I’m looking for appears in exactly four places, formatted and capitalized exactly this way - and GitHub web search still doesn’t find it.

      It wouldn’t surprise me if it’s gotten massively better - but only in the way that choosing to ride a bicycle to work is a massive improvement over sitting on a random rock.

    • Phen@lemmy.eco.br
      link
      fedilink
      arrow-up
      5
      arrow-down
      3
      ·
      1 year ago

      how do you access it? I usually just clone the repo and search locally because I was under the impression there was no way to search code on github.

      • nous@programming.dev
        link
        fedilink
        English
        arrow-up
        10
        arrow-down
        2
        ·
        edit-2
        1 year ago

        Just use the search bar… the only one they have that is on every page at the top right. That takes you to the results which defaults to code, but you can change it on the side to show repos, issues, prs, etc. You can even limit it to single repos or whole organisations.

        • Phen@lemmy.eco.br
          link
          fedilink
          arrow-up
          3
          arrow-down
          3
          ·
          1 year ago

          I guess I got the short stick of some A/B testing then. It doesn’t search further than file names for me.

          • Kuinox@lemmy.world
            link
            fedilink
            arrow-up
            6
            arrow-down
            2
            ·
            edit-2
            1 year ago

            You used the wrong search bar, you just used the one for the file list.
            There is a search icon on the top right.

            • lysdexic@programming.dev
              link
              fedilink
              English
              arrow-up
              3
              arrow-down
              1
              ·
              1 year ago

              You used the wrong search bar, you just used the one for the file list.

              The fact that one of the excuses for GitHub search results being subpar is that there is a right and a wrong search bar is already telling.

              • Kuinox@lemmy.world
                link
                fedilink
                arrow-up
                2
                arrow-down
                2
                ·
                1 year ago

                The fact you call it “search results being subpar” tell me you never used the big top search bar labeled “Type / to search”.
                You can’t make an interface that everyone will understand, there will always be a percentage of user who will be lost.

            • Phen@lemmy.eco.br
              link
              fedilink
              arrow-up
              2
              arrow-down
              2
              ·
              1 year ago

              I used the one on the top right, the same I always used for PRs, issues and stuff like that. It doesn’t search file contents for me.

              • Kuinox@lemmy.world
                link
                fedilink
                arrow-up
                7
                arrow-down
                1
                ·
                1 year ago

                I mean what view do you even get in this case ?
                The code tab, shows… code ?

                • Phen@lemmy.eco.br
                  link
                  fedilink
                  arrow-up
                  2
                  ·
                  1 year ago

                  Tbf I’m just replying from memory, as I’m on vacation this month and I didn’t bring my pc with me, but:

                  I just get a list of repos when searching globally or the regular issue/pr list view when searching inside a repo.

                  I have never seen the view in that screenshot. Has it been there for a long time?

                  • Kuinox@lemmy.world
                    link
                    fedilink
                    arrow-up
                    1
                    arrow-down
                    1
                    ·
                    1 year ago

                    If you used the top search bar, there was always this tab selection.
                    The looks changed a few month ago, but the featureset was visually the same.