How to make your first pull request (and how I made mine)

Опубликовано: 25 Февраль 2025
на канале: Daniel Bourke
3,030
110

I made my first contribution to an open source library by making a pull request to the fastai deep learning repository!

Not sure what a pull request is? Or how you could make one?

This video will help.

Timestamps:
1:48 - What is a pull request?
5:12 - Why make a pull request?
6:23 - How do you make a pull request?

Link to my pull request - https://github.com/fastai/fastai/pull...
Link to my fastai forum post - https://forums.fast.ai/t/pr-ability-t...

What is a pull request?

If you're using an open source library and find an error or want to contribute some of your own features, you can make your own copy of the library, add your changes or fixes and then submit them to the maintainers of the library.

The act of you submitting the changes you made (big or small) is called a pull request.

Why make a pull request?

Many open source libraries are maintained and built by far fewer people than who use them. This is a good thing because of the scalability of software but it means not all features or fixes can be added to the library as fast as you need them.

By contributing to an open source library you're helping not only the maintainers of the library but the people who use it in the future. Contributing to open source via a pull request is also something you can add to your portfolio to show what you've worked on.

How do you make a pull request?

1. Find an open source repository on GitHub which needs help or start with one you've been using.
2. Make a copy of the repository by forking the repository to your own GitHub.
3. Clone your version of the repository to your local machine: git clone repo-address
4. Change into the folder you just cloned: cd cloned-folder-name
5. Create a new branch in your local copy: git checkout -b new-branch-name
6. Make your edits (these could be adding features or fixing code or correcting spelling).
7. Add your changes: git add your-file-with-changes
8. Commit your changes: git commit -m "your message about the changes you made"
9. Push your changes to your new branch (the one you made in step 4): git push origin new-branch-name
10. Check to see if your changes are on GitHub.
11. Go back to the original repository page of the open source library.
12. If you've made the changes right, you should see a green button saying 'Compare & pull request', click it.
13. Enter a message about the changes you've made.
14. Submit your pull request (woohoo!).
15. Wait to hear back from one of the maintainers of the library.

For email updates on videos/articles like this, sign up for more: https://bit.ly/mrdbourkenewsletter

Special thanks to Max Kelsen (https://www.maxkelsen.com) for allowing me to work on problems which led to contributing to the fastai library.

Other helpful links:
Creating a simple Github pull request -    • Creating a Simple Github Pull Request  
Introduction to GitHub - https://lab.github.com/githubtraining...
Creating a pull request - https://help.github.com/en/articles/c...
My Self-Created AI Masters Degree - https://bit.ly/AIMastersDegree

CONNECT:
Web - https://bit.ly/mrdbourkeweb
Quora - https://bit.ly/mrdbourkequora
Medium - https://bit.ly/mrdbourkemedium
Twitter - https://bit.ly/mrdbourketwitter
LinkedIn - https://bit.ly/mrdbourkelinkedin

#machinelearning #deeplearning #fastai