Exercise - Create your first pull request
In this lab, you will learn how to make your first contribution to an open source project. This exercise simplifies and guides the way beginners make their first contribution by walking you through the standard fork → clone → edit → pull request workflow.
You will learn how to:
- Fork a repository
- Clone the repository to your local machine
- Create a branch
- Make changes and commit them
- Push changes to GitHub
- Create a pull request
- Submit your changes for review
This lab takes approximately 30 minutes to complete.
Before you start
To complete the lab, you need:
- A GitHub user account. If you don't have one, you can create a new account. If you need instructions on how to create a GitHub account, refer to the article Creating an account on GitHub.
- Git installed on your local machine. If you don't have git installed, refer to Set up Git.
- A code editor (such as Visual Studio Code).
- A web browser with access to the internet.
Complete the exercise on GitHub
In this exercise, you'll make your first contribution to an open source project by adding your name to a contributors list.
Note: This exercise uses the popular "first-contributions" repository, which has helped over 50,000 people make their first contribution. You'll follow practical, hands-on steps to complete the entire contribution workflow.
The exercise consists of the following activities:
-
Start a web browser and navigate to the exercise repository: https://github.com/firstcontributions/first-contributions
-
Follow the detailed instructions in the README, which will guide you through:
- Forking the repository by clicking the fork button on the top of the page
- Cloning the repository to your local machine using Git
- Creating a branch for your changes
- Making necessary changes by adding your name to the Contributors.md file
- Committing your changes with a descriptive message
- Pushing your changes to your forked repository on GitHub
- Creating a pull request to submit your contribution
-
Work through each step carefully, following the instructions and screenshots provided in the repository.
Note: If you're not comfortable with the command line, the repository also provides tutorials for using GUI tools like GitHub Desktop, Visual Studio Code, and others.
-
Once you submit your pull request, it will be reviewed and merged by the project maintainers.
-
After your pull request is merged, you'll receive a notification email, and you can celebrate your first contribution!
What you've learned
After completing this exercise, you should be able to:
- Fork repositories on GitHub
- Clone repositories to your local machine
- Create branches for your work
- Make commits with meaningful messages
- Push your changes to GitHub
- Create and submit pull requests
- Understand the complete contribution workflow
- Contribute to open source projects
Congratulations! You've completed your first contribution to open source and created your first pull request!