Getting started overview
24 Pull Requests is an annual initiative designed to encourage open source contributions during December. It provides a platform to discover projects and track progress, making the process accessible for developers at all experience levels. To participate, users require a GitHub account, which serves as the primary platform for code hosting, version control, and collaboration. The general workflow involves finding a project, forking its repository, making code changes, and submitting a pull request.
The core process revolves around Git, a distributed version control system, and GitHub, a web-based hosting service for Git repositories. Familiarity with basic Git commands such as git clone, git branch, git commit, and git push is fundamental for participation. For those new to Git, resources like the GitHub Git Handbook provide foundational knowledge. This guide outlines the steps to set up for 24 Pull Requests, from initial account creation to submitting a first contribution.
Quick Reference: 24 Pull Requests Setup
| Step | What to Do | Where |
|---|---|---|
| 1. Create GitHub Account | Sign up for a free GitHub account. | GitHub registration page |
| 2. Link GitHub to 24 Pull Requests | Authorize 24 Pull Requests to access your GitHub profile. | 24 Pull Requests connect page |
| 3. Find a Project | Browse projects suitable for contributions, often filtered by language or difficulty. | 24 Pull Requests projects list |
| 4. Fork Repository | Create a copy of the project's repository under your GitHub account. | Project repository on GitHub |
| 5. Clone Repository | Download your forked repository to your local machine. | Local terminal using git clone |
| 6. Make Changes | Implement your contribution, following project guidelines. | Local development environment |
| 7. Commit and Push | Save your changes to your local repository and upload them to your GitHub fork. | Local terminal using git commit and git push |
| 8. Submit Pull Request | Propose your changes to the original project maintainers. | Your forked repository on GitHub |
Create an account and get keys
Participation in 24 Pull Requests primarily requires a GitHub account. The 24 Pull Requests website itself acts as a directory and tracker, integrating directly with GitHub for user authentication and contribution tracking.
- Create a GitHub Account: If you do not already have one, navigate to the GitHub registration page and follow the prompts to create a new account. This account will be used to host your code, submit pull requests, and interact with project maintainers.
- Connect GitHub to 24 Pull Requests: Once your GitHub account is active, visit the 24 Pull Requests homepage. Click on the prominent "Connect with GitHub" button. This action redirects you to GitHub, where you will be asked to authorize 24 Pull Requests to access certain aspects of your GitHub profile. This authorization allows the 24 Pull Requests platform to display your contributions and track your progress.
There are no API keys or secret credentials to manage directly with 24 Pull Requests, as its functionality relies on GitHub's OAuth authentication flow. Your GitHub account credentials serve as your primary access, and the authorization granted to 24 Pull Requests is managed through your GitHub authorized OAuth Apps settings.
Your first request
Submitting your first pull request through 24 Pull Requests involves a series of steps that leverage Git and GitHub workflows. This example outlines a general process; always consult the specific project's contribution guidelines for detailed instructions.
- Find a Project: Navigate to the 24 Pull Requests projects list. You can filter projects by programming language, difficulty level, or available issues. Look for issues labeled "good first issue" or "help wanted" if you are new to contributing.
- Fork the Repository: Once you select a project, go to its GitHub repository page. Click the "Fork" button in the upper right corner. This creates a personal copy of the repository under your GitHub account. This fork allows you to make changes without affecting the original project until you are ready to submit them.
- Clone Your Fork: On your forked repository's page, click the green "Code" button and copy the HTTPS or SSH URL. Open your local terminal or command prompt and clone the repository to your machine:
git clone [your-fork-url] cd [repository-name] - Create a New Branch: It is good practice to create a new branch for your changes. This isolates your work and keeps the
mainormasterbranch clean:git checkout -b my-contribution-branch - Make Your Changes: Open the project in your preferred code editor and implement your proposed changes. Ensure you adhere to the project's coding style and contribution guidelines.
- Test Your Changes (if applicable): If the project includes tests, run them to verify that your changes do not introduce new issues and that existing functionality remains intact.
- Commit Your Changes: Stage your changes and commit them with a descriptive message:
git add . git commit -m "Descriptive message about my contribution" - Push Changes to Your Fork: Upload your committed changes from your local machine to your forked repository on GitHub:
git push origin my-contribution-branch - Create a Pull Request: Go to your forked repository on GitHub. GitHub will often display a banner suggesting you create a pull request from your recently pushed branch. If not, navigate to the "Pull requests" tab and click "New pull request." Ensure the base repository is the original project's
mainbranch and the head repository is your fork's new branch. Provide a clear title and detailed description of your changes, referencing any relevant issues.
After submitting the pull request, project maintainers will review your contribution. They may request changes or merge your pull request if it meets their criteria. Once merged, your contribution will be counted by 24 Pull Requests.
Common next steps
Once you have successfully submitted your first pull request, several common next steps can enhance your open source journey and continue your engagement with 24 Pull Requests:
- Monitor Your Pull Request: Keep an eye on your submitted pull request for comments or requests for changes from the project maintainers. Respond promptly to feedback to facilitate the merging process. You can find your pull requests on your GitHub pull requests page.
- Address Feedback: If maintainers request changes, make the necessary modifications in your local branch, commit them, and push them to your fork. These new commits will automatically update your existing pull request.
- Explore More Projects: Continue browsing the 24 Pull Requests project list to find more opportunities to contribute. Aim for a variety of projects or focus on a technology stack you want to improve.
- Learn Advanced Git Workflows: As you gain experience, explore more advanced Git features like rebasing, squashing commits, and managing upstream remotes. The Mozilla Developer Network Git Rebase documentation is a good starting point for understanding rebase.
- Engage with the Community: Join project-specific communication channels (e.g., Slack, Discord, mailing lists) to ask questions, offer help, and learn from other contributors.
- Contribute Beyond Code: Open source contributions are not limited to code. You can also contribute by improving documentation, writing tests, triaging issues, or helping new contributors.
- Set Up a Development Environment: For more complex projects, setting up a consistent local development environment is crucial. Tools like Docker or virtual environments can help manage dependencies.
Troubleshooting the first call
Encountering issues during your first pull request is common. Here are some frequent problems and their potential solutions:
- Issue: Cannot push changes to the original repository.
- Problem: You are trying to push directly to the original project's repository instead of your fork.
- Solution: Ensure you have forked the repository and are pushing to your personal fork. Your remote
originshould point to your fork, not the upstream repository.
- Issue: Git authentication errors (e.g., "Authentication failed").
- Problem: Incorrect GitHub credentials or SSH key setup.
- Solution: If using HTTPS, ensure you are using a GitHub Personal Access Token (PAT) instead of your password, especially after GitHub deprecated password authentication for Git operations. If using SSH, verify your SSH key is correctly set up and added to your GitHub account.
- Issue: "This branch has conflicts that must be resolved."
- Problem: Changes in the original project's
mainbranch conflict with your changes. - Solution: You need to resolve merge conflicts. Pull the latest changes from the original repository into your branch (
git pull upstream main, assuming you've added the original repo asupstream), resolve conflicts locally, commit, and push.
- Problem: Changes in the original project's
- Issue: Pull request not showing up on 24 Pull Requests.
- Problem: The pull request might not be correctly linked or detected by the 24 Pull Requests platform.
- Solution: Ensure your pull request is opened against a project listed on 24 Pull Requests. Sometimes there's a delay in synchronization; check back after a few hours. Verify that your GitHub account is still connected to 24 Pull Requests.
- Issue: Project tests failing after your changes.
- Problem: Your code changes introduced a bug or broke existing functionality.
- Solution: Review the test failure messages carefully. Revert your changes partially, or step through your code with a debugger to identify the issue. Ensure you ran local tests before pushing (if available).