{"id":1239,"date":"2017-06-16T16:50:11","date_gmt":"2017-06-16T16:50:11","guid":{"rendered":"http:\/\/www.testingdocs.com\/questions\/?p=1239"},"modified":"2021-03-20T13:31:33","modified_gmt":"2021-03-20T13:31:33","slug":"how-to-fork-a-repository-on-github","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/how-to-fork-a-repository-on-github\/","title":{"rendered":"How to fork a repository on GitHub?"},"content":{"rendered":"<h3><strong>What is a fork?<\/strong><\/h3>\n<p>A fork is a copy of a Git repository. Forking a repository allows you to collaborate on others project. It makes easy to work as a team on a project. Sometimes, fork allows you to use someone else&#8217;s project as a starting point for your own work.<\/p>\n<h3><strong>How to fork a repository?<\/strong><\/h3>\n<p>Log on to the GitHub Dashboard.<br \/>\nNavigate to the repository that you want to fork.<br \/>\nIn the top-right corner, click on the Fork button.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-940\" src=\"http:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Fork-a-GitHub-Repository.png\" alt=\"Fork a GitHub Repository\" width=\"1365\" height=\"577\" title=\"\"><\/p>\n<h3><\/h3>\n<h3><strong>Workflow<\/strong><\/h3>\n<p>The simple and common workflow is described as below:<\/p>\n<p>You fork the repository.<br \/>\nCreate a local clone of the forked repository on your local machine.Open git and type the following git command to clone<\/p>\n<p><strong>$ git clone https:\/\/github.com\/&lt;your username&gt;\/&lt;repository name&gt;<\/strong><\/p>\n<p>Note: remove placeholders &lt; , &gt; in the command you issue.<\/p>\n<p>Work on a feature\/ change\/ fix a bug to the project.<\/p>\n<p>Example:<\/p>\n<p><strong>$ git checkout -b feature\/new-service master<\/strong><\/p>\n<p>Push your changes.<\/p>\n<p>Example:<\/p>\n<p><strong>$ git push -u origin feature\/new-service<\/strong><\/p>\n<p>Submit a pull request to the project owner.<br \/>\nProject owner reviews the work, if everything looks good, the pull request would be accepted. The feature\/change\/ bug fix would be pulled into the upstream or the original repository.<\/p>\n<p>Example<\/p>\n<p><strong>$ git checkout master<\/strong><\/p>\n<p><strong>$ git pull upstream master<\/strong><\/p>\n<p>Rebase with master<\/p>\n<p>Example<\/p>\n<p><strong>$ git checkout bug-fix-branch<\/strong><\/p>\n<p><strong>$ git rebase master<\/strong><\/p>\n<!--themify_builder_content-->\n<div id=\"themify_builder_content-1239\" data-postid=\"1239\" class=\"themify_builder_content themify_builder_content-1239 themify_builder tf_clear\">\n    <\/div>\n<!--\/themify_builder_content-->\n","protected":false},"excerpt":{"rendered":"<p>What is a fork? A fork is a copy of a Git repository. Forking a repository allows you to collaborate on others project. It makes easy to work as a team on a project. Sometimes, fork allows you to use someone else&#8217;s project as a starting point for your own work. How to fork a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[32],"class_list":["post-1239","post","type-post","status-publish","format-standard","hentry","category-git","tag-git","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/1239","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=1239"}],"version-history":[{"count":3,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/1239\/revisions"}],"predecessor-version":[{"id":19571,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/1239\/revisions\/19571"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=1239"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=1239"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=1239"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}