<div class="xblock xblock-public_view xblock-public_view-vertical" data-course-id="course-v1:MOOC-FLOSS+101+2021_1" data-init="VerticalStudentView" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="vertical" data-usage-id="block-v1:MOOC-FLOSS+101+2021_1+type@vertical+block@chap-03-seq-05-ver-01" data-request-token="02da0d30902e11ee8c631237928d7ffd" data-graded="False" data-has-score="False">
<div class="vert-mod">
<div class="vert vert-0" data-id="block-v1:MOOC-FLOSS+101+2021_1+type@html+block@chap-03-seq-05-ver-01-html-01">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MOOC-FLOSS+101+2021_1" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MOOC-FLOSS+101+2021_1+type@html+block@chap-03-seq-05-ver-01-html-01" data-request-token="02da0d30902e11ee8c631237928d7ffd" data-graded="False" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<div class="edit-link-wrapper"><div class="edit-link"><p style="text-align: right;"><a href="https://gitlab.com/-/ide/project/mooc-floss/mooc-floss/edit/master/-/course/html/chap-03-seq-05-ver-01-html-01.html" target="_blank"><i class="fa fa-pencil mr-1"></i> Edit on Gitlab</a></p></div><div class="edit-link-original-content"><div class="flex flex-grow flex-col gap-3">
<div class="min-h-[20px] flex flex-col items-start gap-4 whitespace-pre-wrap break-words">
<div class="markdown prose w-full break-words dark:prose-invert light">
<p>The fork and pull model is a common way to contribute to open-source projects. It involves creating a fork of the original repository, making changes in the fork, and then submitting a pull request to the original repository (called upstream) to merge the changes.</p>
<p>The overall process consists of creating and making changes on a <strong>fork</strong> of a project, then getting in touch with the original developers by creating a <strong>pull request</strong> (or <strong>merge request</strong>) to discuss and validate your contribution so that they <strong>merge</strong> those contributions into the original project.</p>
<p><img src="/assets/courseware/v1/7ca3bb5eeb5b8a8ade9af8de643028a2/asset-v1:MOOC-FLOSS+101+2021_1+type@asset+block/fork_pull_model_rized.svg" alt="fork and merge representation" width="665" height="299" /></p>
<p>Here are the typical steps for contributing to an open-source project using the fork and pull model. You can look at the figure bellow to understand better this process.</p>
<ol>
<li>
<p>Fork the original repository: Create a copy of the upstream (original) repository in your personal forked repository (let's call it "origin"). Usually, this happens on the same software forge and the forked repository remembers from which original repository it was forked.</p>
</li>
<li>
<p>Clone the fork: Clone the forked repository to your local machine.</p>
</li>
<li>
<p>Create a new branch, make changes and commit then:</p>
<ul>
<li>
<p>Create a new branch: In your local repository, use a name for your branch to reflect the bugfix or feature you are working on.</p>
</li>
<li>
<p>Make changes: Make the necessary changes to the files in your local repository.</p>
</li>
<li>
<p>Commit changes: Commit the changes to the new branch in your local repository.</p>
</li>
</ul>
</li>
<li>
<p>Push changes: Push the new branch and its commits to your forked repository (origin).</p>
</li>
<li>
<p>Create a pull request, wait for the review and address feedback:</p>
<ul>
<li>
<p>On the forge, create a pull request (sometimes called a merged request) to the upstream (original) repository.</p>
</li>
<li>
<p>Wait for review: Wait for the maintainers of the upstream (original) repository to review your changes and provide feedback.</p>
</li>
<li>
<p>Address feedback: If necessary, make changes to your branch in response to the feedback from the maintainers.</p>
</li>
<li>
<p>Merge changes: Once the maintainers approve your pull request, they will merge your changes into the upstream (original) repository.</p>
</li>
</ul>
</li>
<li>You may one day pull from the upstream (original) repository your changes that have been merged in the master/main branch.</li>
</ol>
<p>Overall, the fork and pull model is a powerful way for developers to contribute to open-source projects and collaborate with others in the development community.</p>
</div>
</div>
</div>
<p></p>
<p><img src="/assets/courseware/v1/34f8be1ac43d3dbaf16232edef1bb126/asset-v1:MOOC-FLOSS+101+2021_1+type@asset+block/git-flow.svg" alt="git flow with fork and pull request (or merge request)" width="1000" height="1000" /></p>
<p>image source: <a href="https://freesvg.org/git-flow" target="_blank" rel="noopener">https://freesvg.org/git-flow</a></p>
<p></p></div></div>
</div>
</div>
<div class="vert vert-1" data-id="block-v1:MOOC-FLOSS+101+2021_1+type@html+block@6477410b5b7f4c77bb99fb06d8064574">
<div class="xblock xblock-public_view xblock-public_view-html xmodule_display xmodule_HtmlBlock" data-course-id="course-v1:MOOC-FLOSS+101+2021_1" data-init="XBlockToXModuleShim" data-runtime-class="LmsRuntime" data-runtime-version="1" data-block-type="html" data-usage-id="block-v1:MOOC-FLOSS+101+2021_1+type@html+block@6477410b5b7f4c77bb99fb06d8064574" data-request-token="02da0d30902e11ee8c631237928d7ffd" data-graded="False" data-has-score="False">
<script type="json/xblock-args" class="xblock-json-init-args">
{"xmodule-type": "HTMLModule"}
</script>
<div class="edit-link-wrapper"><div class="edit-link"><p style="text-align: right;"><a href="https://gitlab.com/-/ide/project/mooc-floss/mooc-floss/edit/master/-/course/html/6477410b5b7f4c77bb99fb06d8064574.html" target="_blank"><i class="fa fa-pencil mr-1"></i> Edit on Gitlab</a></p></div><div class="edit-link-original-content"><p>Resources if you want to go further:</p>
<p> <a href="https://en.wikipedia.org/wiki/Fork_and_pull_model" target="[object Object]">https://en.wikipedia.org/wiki/Fork_and_pull_model</a> </p>
<p><a href="https://en.wikipedia.org/wiki/Distributed_version_control#Pull_requests" target="[object Object]">https://en.wikipedia.org/wiki/Distributed_version_control#Pull_requests</a> </p>
<p><a href="https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/getting-started/about-collaborative-development-models" target="[object Object]">https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/getting-started/about-collaborative-development-models</a></p>
<p><a href="https://en.wikipedia.org/wiki/Git#Conventions" target="[object Object]">https://en.wikipedia.org/wiki/Git#Conventions</a></p>
<p><a href="https://opensource.stackexchange.com/questions/352/what-exactly-is-a-pull-request" target="[object Object]">https://opensource.stackexchange.com/questions/352/what-exactly-is-a-pull-request</a> </p>
<p><a href="https://stackoverflow.com/questions/22199432/pull-request-vs-merge-request" target="[object Object]">https://stackoverflow.com/questions/22199432/pull-request-vs-merge-request</a></p>
<p><a href="https://docs.github.com/en/pull-requests/collaborating-with-pull-requests" target="[object Object]">https://docs.github.com/en/pull-requests/collaborating-with-pull-requests</a> </p>
<p><a href="https://docs.gitlab.com/ee/user/project/merge_requests/" target="[object Object]">https://docs.gitlab.com/ee/user/project/merge_requests/</a> </p>
<p></p></div></div>
</div>
</div>
</div>
<script type="text/javascript">
(function (require) {
require(['/static/js/dateutil_factory.a28baef97506.js?raw'], function () {
require(['js/dateutil_factory'], function (DateUtilFactory) {
DateUtilFactory.transform('.localized-datetime');
});
});
}).call(this, require || RequireJS.require);
</script>
<script>
function emit_event(message) {
parent.postMessage(message, '*');
}
</script>
</div>