Hacktoberfest is an annual event where individual contributors come together to contribute to open source projects by adding new features, fixing bugs, improving documentation, etc.
You can earn cool swag or digital goodies as a reward, you typically need to make a certain number of contributions to any open source projects on platforms like GitHub during the month of October.
It's a chance to grow your skills, connect with others in the coding community, and have fun along the way!
Before we start, make sure you have;
🙌 Here's a step-by-step guide to contributing to open source:
Before you start, find an open source projects that interests you. It could be a tool you use, or something related to your field of expertise. GitHub is a popular platform for hosting open source projects, click here to search for projects that accepts contributions for hacktoberfest!
On the project's GitHub page, click the "Fork" button in the top right corner. This creates a copy of the project in your GitHub account. Now you have to clone your forked repository to your local machine by entering the command below:
git clone https://github.com/your-username/project.git
Remember to change the project name and your-username in to above command. Then navigate to the project directory:
Create a new branch to make your changes. This helps keep your changes isolated from the main project. To create a new branch, enter the following command:
git checkout -b your-feature-branch
Now, its time to make the changes you want to contribute. Maybe you want to add a new feature, fix a bug, or improve documentation.
Commit your changes to the branch you created in Step 3. Use the following commands:
# Add changes to the staging area
git add .
# Commit changes with a descriptive message
git commit -m "Description of your changes"
If you are making multiple changes, you can repeat this step as many times as you want.
Push your changes to your GitHub repository by entering the following command.
git push origin your-feature-branch
This will transfer your commit(s) from local repository to remote repository (your GitHub account).
Go to your GitHub repository and click on the "Compare & pull request" button. Compare the changes and submit the PR (click on "Create pull request" button). Remember to write a title and description for your PR.
After you create a pull request, you can ask a specific person (maintainer) to review your proposed changes and be prepared to receive feedback on your pull request. Make necessary changes based on feedback until your contribution is accepted.
Keep your forked repository updated with the changes from the original project. You can enter following commands in your terminal to do so:
# Add the original project as a remote
git remote add upstream https://github.com/original-project/project.git
# Fetch changes from the original project
git fetch upstream
# Merge changes into your branch
git merge upstream/main
Once your contribution is merged, celebrate your success! You've officially contributed to open source. Remember that contributing to open source is a learning process, and it's okay to ask for help or clarification.
Each project has its own rules, so be sure to read and follow the project's contribution guidelines (you can find in the project's repository).
Happy Hacking! 🚀✨