Github pull request workflow
Contributing to open-source projects is a good way to learn the nuances of software development. Reading, understanding and making meaningful changes to code that other people wrote is an important skill to master. In addition to that, it is a good way to give back to the software development community.
However, it may be scary and confusing for new developers to start contributing to open-source projects. First Timers Only is a great place to get started with open source contribution. This article is a short, step-by-step guide to submitting a pull request to any git repository that allows it.
Pre-Requisites
- Basic working knowledge of git, Github. This is a good tutorial for the same.
- An IDE. VSCode is highly recommended.
Pull Request Workflow
- Open a GitHub repository of your choice.
- Fork the repository by pressing the Fork icon at the top right corner. This creates a copy of the repository in your list of GitHub repositories.
- Go to the forked repository in your GitHub and clone the repository to your local machine and open the cloned folder using VSCode or some other IDE.
- Create a new branch and cd into that branch for your edits using git checkout -b your-new-branch-name
- Make the changes that you intend to make.
- Once done with changes, stage and commit these changes using git add . and git commit -m "your-commit-message" commands.
- Push the changes to GitHub using git push origin your-new-branch-name command.
- Open the forked repository (the one in your GitHub repo list) and you should see, near the top, a panel indicating recent changes made by you and the option to Compare and pull request. Press that button and the final window to open a pull request will appear. Describe your changes well and submit the pull request.
- That’s all, you have submitted a pull request which will now be reviewed and merged by maintainers of the repository.