Home >Development Tools >git >Completely understand how to correctly retrieve resources on GitHub!

Completely understand how to correctly retrieve resources on GitHub!

藏色散人
藏色散人forward
2022-12-30 16:22:472949browse
<div class="ui readme markdown-body content-body fluidbox-content"> <div class="toc-wraper ui card column author-box grid pt-2" style="display:none"><a href="javascript:void(0);" class="close-toc pull-right" style="width: 20px;position: absolute;right: 7px;top: 3px;margin-bottom: 20px;">                                <em class="icon remove text-mute "></em>                            </a></div> <p style="text-align: center;"><img src="https://img.php.cn/upload/article/000/000/020/63ae9f1eb9743454.jpg" alt="Completely understand how to correctly retrieve resources on GitHub!" ></p> <p>When I was a beginner open source contributor, one of my biggest challenges was finding the right projects/problems to work on. </p> <p>For a long time I relied on resources from various writers on the internet (which are great, by the way). But I’ve always wanted to find a solution to this problem—a way that I could search for and track projects that fit my skill set. </p> <p>Let’s agree on one thing: unlike Google, searching GitHub isn’t easy. But as a developer, there's a good chance you interact with GitHub or Gitlab every day. </p> <p>The question now is not what you use these version control systems for, but how you use them. Just like mastering Google search skills is essential for any average internet user, I believe it is essential for developers to learn how to search GitHub effectively. </p> <p>In this article, we’ll cover different techniques on how to properly search GitHub. You will learn how to search for:</p> <ul> <li>Issues and Pull Requests</li> <li>Repositories</li> <li>Users</li> <li>Topics</li> </ul> <p> and more. let's start. </p> <h2 id="d97aba">GitHub Search Queries</h2> <p>To find detailed information about something online, you need to have the right search skills. The same goes for GitHub — to find detailed information, you can easily find specific Issues and Pull Requests for a given project using common filtering, sorting, and search techniques. </p> <p>Although you list multiple resources for different projects on the Internet, the main problem comes when you want to search for them yourself. How to get started? Which keywords should you use to find the right results? </p> <p>Most maintainers tend to label their projects as issues, which makes it easier for contributors to find suitable projects. Listed below are some tips that may help you when using <code>GitHub</code>. </p> <h3 id="28d1ca">How to search for issues and submit pull requests on GitHub</h3> <p>One of the most common ways to find projects to contribute to is by searching for issues and related PRs. Here are some tips you can use to easily find reliable answers: </p> <ul style="list-style-type: disc;"> <li><p><strong><a href="https://github.com/search?q=is%3Aissue+is%3Aopen+label%3Abeginner&type=issues" rel="nofollow noopener noreferrer">is:issue is:open label:beginner</a></strong> - This particular query will Lists all projects that have been opened and marked as beginner questions. </p></li> <li><p><strong><a href="https://github.com/search?q=is%3Aissue+is%3Aopen+label%3Aeasy&type=issues" rel="nofollow noopener noreferrer">is:issue is:open label:easy</a></strong> - This lists all open issues that are marked as easy. </p></li> <li><p><strong><a href="https://github.com/search?q=is%3Aissue+is%3Aopen+label%3Afirst-timers-only&type=issues" rel="nofollow noopener noreferrer">is:issue is:open label:first-timers-only</a></strong> - This lists all open issues to which first-timers are welcome . </p></li> <li><p><strong><a href="https://github.com/search?q=is%3Aissue+is%3Aopen+label%3Agood-first-bug&type=issues" rel="nofollow noopener noreferrer">is:issue is:open label:good-first-bug</a></strong> - This lists the first ones marked as suitable for resolution Projects with wrong open issues to attract contributors to work on them. </p></li> <li><p><strong><a href="https://github.com/search?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22&type=issues" rel="nofollow noopener noreferrer">is:issue is:open label:"good first issue"</a></strong> - This will list all open issues with the label "Good first question", which means this is a good place for beginners to start. </p></li> <li><p><strong><a href="https://github.com/search?q=is%3Aissue+is%3Aopen+label%3Astarter&type=issues" rel="nofollow noopener noreferrer">is:issue is:open label:starter</a></strong> - Lists all open issues labeled <code>starter</code> question. </p></li> <li><p><strong><a href="https://github.com/search?q=is%3Aissue+is%3Aopen+label%3Aup-for-grabs&type=issues" rel="nofollow noopener noreferrer">is:issue is:open label:up-for-grabs</a></strong> - Lists all open issues, if you have the necessary Skills can be processed at any time. </p></li> <li><p><strong><a href="https://github.com/search?q=no%3Aproject+type%3Aissue+is%3Aopen&type=issues" rel="nofollow noopener noreferrer">no:project type:issue is:open</a></strong> - will list all open issues that are not assigned to a specific project. </p></li> <li><p><strong><a href="https://github.com/search?q=no%3Amilestone+type%3Aissue+is%3Aopen&type=issues" rel="nofollow noopener noreferrer">no:milestone type:issue is:open</a></strong> - Many times, projects are tracked using milestones. However, if you want to find untracked issues, this search query will list those items for you. </p></li> <li><p><strong><a href="https://github.com/search?q=no%3Alabel+type%3Aissue+is%3Aopen&type=issues" rel="nofollow noopener noreferrer">no:label type:issue is:open</a></strong> - This will list all open issues that are not labeled. </p></li> <li><p><strong><a href="https://github.com/search?q=is%3Aissue+is%3Aopen+no%3Aassignee&type=issues" rel="nofollow noopener noreferrer">is:issue is:open no:assignee</a></strong> - Lists all open issues that have not been assigned to someone. </p></li> </ul> <h3 id="cc5d01">How to search a repository</h3> <p>By default, to search, you just enter the repository name in the search bar! You will get some search results. </p> <p>But the chances of you getting the exact buyback you want are very low. </p> <p> Let’s look at some ways you can narrow down your search: </p> <h4 id="bb6370">How to find by name, description/README </h4> <p> Things to note when searching by name and description of a readme file The point is that the search phrase should start with the <code>in</code> qualifier. This makes it possible to search "inside" what you're looking for. </p> <p><strong>Example</strong></p> <ul> <li><p>Use <code>in:name</code>. Let's say you're looking for resources to learn more about data science. In this case, you can use the <code>Data Science in:name</code> command, which will list the repositories that have Data Science in the repository name. </p></li> <li><p>Use <code>in:description</code>. If you want to find repositories with a specific description, for example, the repository's description contains the word "freeCodeCamp", our search would be: <code>freecodecamp in:description</code></p></li> <li><p>Use <code>in:readme</code>. You use it to search a file's README for a certain phrase. If we wanted to find repositories with the word freecodecamp in their README, our search would be: <code>freecodecamp in:readme</code>.</p></li> <li><p>Use <code>in:topic</code>. You use it to find whether a certain phrase or word is tagged in a topic. For example, to find all repositories that have freecodecamp listed in the topic, our search would be: <code>freecodecamp in:topic</code></p></li> </ul> <p> You can also combine multiple search queries to further narrow your search. </p> <h4 id="6e602a">How to search based on Stars, Forks</h4> <p>You can also search repositories based on how many Stars and Forks a project has. This makes it easier for you to know how popular the item is. </p> <p><strong>Example</strong></p> <ul> <li><p>Use <code>stars:n</code>. If you were searching for a repository with 1000 stars, your search query would be <code>stars:1000</code>. This will list repositories with 1000 stars. </p></li> <li> <p>Use <code>forks:n</code>. This specifies the number of forks the repository should have. If you wanted to find repositories with fewer than 100 forks, your search would be: <code>forks:<100</code>. </p></li></ul><p> Fortunately you can always use relational operators, such as <code><</code>, <code>></code>, <code><=</code>, <code>>=</code> and <code>..</code> help you further narrow your search. </p> <h4 id="ba361c">How to Find by Language</h4> <p>Another cool way to search on GitHub is to search by language. This can help you filter out repositories for a specific language. </p> <p><strong>Example: </strong></p> <ul><li>Use <code>language:LANGUAGE</code>. For example, if you wanted to find repositories written in PHP, your search would be: <code>language:PHP</code> </li></ul> <h4 id="0b2df0">How to find by organization name</h4> <p> You can also Search repositories/projects maintained or created by a specific organization. To do this, you need to start your search with the keyword <code>org:...</code>, followed by the organization name. </p> <p>For example, if you search for <code>org:freecodecamp</code>, it will list repositories that match freeCodeCamp. </p> <h4 id="13b25f">How to Find by Date</h4> <p> If you want your results to be based on a specific date, you can search using one of these keywords: <code>created</code>, <code> updated</code>, <code>merged</code> and <code>closed</code>. These keywords should be used along with a date in the format <code>YYYY-MM-DD</code>. </p> <p><strong>Example: </strong></p> <ul><li>Use <code>keyword:YYYY-MM-DD</code>. For example, we want to search all repositories with the word freeCodeCamp created after 2022-10-01. Then our search will be: <code>freecodecamp created:>2022-10-01</code> </li></ul> <p>You can also use <code><</code>, <code>> </code>, <code>>=</code> and <code><=</code> to search for dates after, before and after a specified date. To search within a range you can use <code>...</code>.</p> <h4 id="9ad2f2">How to find by license<a href="#9ad2f2" class="anchorific" style="display: none;"></a> </h4> <p>#When you are looking for a When contributing to a project, the license is very important. Different licenses give different rights to what contributors can or cannot do. </p> <p> To make it easier for you to find projects with the correct license, you need to have a good understanding of the license. You can read more about them <a href="https://www.freecodecamp.org/news/how-open-source-licenses-work-and-how-to-add-them-to-your-projects-34310c3cf94/" rel="nofollow noopener noreferrer">here</a>. </p> <p><strong>Example: </strong></p> <ul><li>Use <code>license:LICENSE_KEYWORD</code>. This is a great way to search for projects with a specific license. For example, to search for projects with an MIT license, you would use <code>license:MIT</code>.</li></ul> <h4 id="1980ba">How to find by visibility<a href="#1980ba" class="anchorific" style="display: none;"></a> </h4> <p># You can also search based on a repository's visibility. In this case, you can use public or private. This will match issues and PRs in public or private repositories respectively. </p> <p><strong>Example: </strong></p> <ul> <li>Use <code>is:public</code>. This will display a list of public repositories. Let's take an example where we want to search all public repositories owned by freeCodCamp. Then our search will be: <code>is:public org:freecodecamp</code>. </li> <li>Use <code>is:private</code>. This query aims to list all private repositories under a given search query. </li> </ul> <h2 id="54bbba">Conclusion</h2> <p> Although we have covered many search queries here, you can still further narrow your search by combining multiple parameters together. </p> <p>For more resources and more search parameters, you can check out the <a href="https://docs.github.com/en/search-github/searching-on-github" rel="nofollow noopener noreferrer">GitHub documentation</a> or use <a href="https://github.com/search/advanced?" rel="nofollow noopener noreferrer">Advanced GitHub Search</a>. These methods always come in handy as they provide more filtering options. </p> <p>You can use a variety of search parameters to simplify your daily activities on GitHub. Hopefully this will help you use this platform more easily and effectively. </p> <blockquote style="font-size: 0.9em;border: 1px dashed #dce0e4;border-radius: 5px;padding: 13px 25px;"> <p style="margin-bottom: 0px;">Original address: <a href="https://www.freecodecamp.org/news/github-search-tips/" rel="nofollow noopener noreferrer">https://www.freecodecamp.org/news/github...</a></p> <p>Translation address: <a href="https://learnku.com/laravel/t/73213">https:// learnku.com/laravel/t/73213</a></p> </blockquote> </li> </ul> </div>

The above is the detailed content of Completely understand how to correctly retrieve resources on GitHub!. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete