Fork, Pull Request & Merge
A comprehensive step-by-step guide to forking a repository, creating a pull request, and merging changes on GitHub.
In this guide, you'll learn how to contribute to a project by forking it, making changes, and submitting a pull request to merge those changes back into the original repository.
Why Fork & PR?
Forking allows you to freely experiment with changes without affecting the original project. Pull Requests (PRs) are the bridge that lets you propose those changes for review and eventual merging into the main project.
Phase 1: Forking the Repository
Forking creates a personal copy of someone else's project in your own GitHub account.
Navigate to the original repository on GitHub and click the Fork button located in the top-right corner of the page.

Select your own GitHub account or an organization where you want the fork to be created.

If you are part of multiple organizations, ensure you select the correct one (e.g., tech-dti).

You can keep the original name or give it a new one. Type a name if you wish to change it.

Click the Create fork button. GitHub will now copy the repository to your account.

Phase 2: Making Changes
Once you have your own fork, you can make changes directly through the GitHub Web UI (or locally on your machine).
In your forked repository, click on the file you want to edit (e.g., README.md).

Click on the Edit this file (pencil icon) to start making changes.

Type your changes into the editor. For example, add a new label or update documentation text.

Click on Commit changes... at the top right to start the save process.

Provide a brief commit message describing your changes and click Commit changes.

Alternative: Making Changes Locally
If you prefer working on your own machine, you can clone your forked repository and make changes locally.
Copy the SSH or HTTPS URL of your forked repository and run the following command in your terminal:
git clone https://github.com/your-username/repository-name.gitGo into the project folder and open the file you want to change (e.g., README.md) in your favorite editor.
cd repository-name
# Open README.md and make your changesOnce you've made your changes, stage them and create a commit.
git add .
git commit -m "commit message"Push your local changes back to your forked repository on GitHub.
git push origin mainNext Step
After pushing your changes locally, you can proceed to Phase 3 to create a Pull Request on GitHub.
Phase 3: Creating a Pull Request
After committing your changes to your fork, it's time to propose them to the original project.
Click on the Code tab to go back to the main view of your forked repository.

Click the Contribute button to see options for syncing or contributing.

Click on Open pull request. This will take you to the original repository's PR creation page.

Type a meaningful title and description for your pull request (e.g., "updated readme file").

Click on Create pull request. The maintainers of the original repository will now see your proposal.

Phase 4: Merging the Pull Request
Once the pull request is approved, it can be merged into the target branch.
As a maintainer (or if you have permissions), click the Merge pull request button.

You can add an extended description or notes for the merge if necessary.

Click Confirm merge. GitHub will now integrate the changes from your pull request into the project.

Success!
Your changes are now part of the main project. Don't forget to sync your fork with the upstream repository periodically to stay up to date!