Pull request

You have forked the repository so it knows its origins. This will allow us to use GitHub's special function to bundle all changes made. Then, we can easily send them in a special format to the original repository. Then, they can be easily applied to the original project. If approved, your contribution becomes part of the open source project and GitHub keeps that visible.

The maintainers of some projects keep a list of all contributors to their project on a visible place. This way, they acknowledge the contribution to the project and share that with the community.

The format that GitHub uses to send the changes back to the original project repository is called a pull request.

A pull request shows all the changes that you have made in your repository (a specific branch in it) compared to the origin. Once the request is opened, it tracks all the changes between two repositories. This means that you can do some extra commits and they will become part of the pull request if it's still opened.

The process of accepting (merging) a pull request might take extra time. Usually, the change is checked by the project maintainers; they comment and suggest improvements if there are any, and once everything is resolved and it matches the raised quality and project style, the request can be accepted.


It's possible to accept or reject a pull request.

Once your pull request is accepted, then your contribution will become part of the original project and who uses it in the future might use your feature.

Now, let's create your first pull request step by step.

First, confirm that you have committed the change and pushed the result to your repository. You can do that with the following command from the Terminal, if you are in the root folder of the project:

git add .
git commit -m "Extend the configuration to have a control over the list of filters"

This will create a local commit, which should be pushed to GitHub. You can do this with the following command:

git push 

Now, you have to open the project in a browser. It should be located at https://github.com/{user-name}/YPImagePicker. Don't forget to replace {user-name} with your GitHub username:

You have to click on the New pull request button. This will prepare the pull request and you will see its details:

pull request

You will see a lot of information about the new pull request that will be created. The page shows all the commits and all the changes:

You can add a title and explain more about the actual pull request. We have entered some basic details about the implementation and possible improvements.

You can click on the Create pull request button at the bottom. This will create your pull request and a special thread where a discussion can be started with the maintainers.

You can verify that your pull request is opened. Just open the project's page and click on the Pull requests tab:

You can see the pull request that we created listed here. Once it's closed, you can find it in the closed section:

The changes that we have done here are already sent and are merged to the original project. You can decide to add something new to this library or to any other. The process should be clear and easy now that you have read this chapter.

Let's check what we have learned about GitHub and open source projects.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.186.83