Thank you for considering to contribute to this repository! This file will walk you through all the steps to ensure both you and I have a good time submitting and reviewing your contribution. First off, some basic rules and reading material:
- Submit your work in a new branch and make the PR to the master branch.
- Write a short & descriptive commit message.
- Rebase before committing the final change.
- Stick to PSR-2.
- Add tests if necessary and ensure all the tests are green on the final commit.
- Make sure the CI tools used by the repository are all in order. If one fails, you should make it pass.
Here are the steps to follow to contribute to this repository:
- Fork this repository on GitHub.
- Clone your fork to your local machine.
- Create a feature branch.
- Add an 'upstream' remote.
- Regularly pull & rebase from the upstream remote.
- Work on feature branch.
- Submit a pull request to the master branch.
Fork the repository right here on GitHub. To learn more about forking a repository, visit GitHub's help article.
Clone your repository on your local machine to start work on your pull request.
$ git clone git@github.com:<USERNAME>/<REPOSITORY>.git
# Or if you prefer HTTPS:
$ git clone https://github.com/<USERNAME>/<REPOSITORY>.git
$ cd <REPOSITORY>
Make your own feature branch in order not to clutter up master.
# Think of a good name for your branch:
# fix/typo-in-readme
# feature/some-feature
# bug/some-bug-you-are-fixing
$ git checkout -b <BRANCH_NAME>
Add an 'upstream' remote to pull from and to stay up to date with the work being done in there.
# List all current remotes
$ git remote -v
origin git@github.com/<USERNAME>/<REPOSITORY>.git (fetch)
origin git@github.com/<USERNAME>/<REPOSITORY>.git (push)
# Add a new remote called 'upstream'
$ git remote add upstream git@github.com:san-kumar/<REPOSITORY>.git
# Or if you prefer HTTPS:
$ git remote add upstream https://github.com/san-kumar/<REPOSITORY>.git
# The new remote should now be in the list
$ git remote -v
origin git@github.com/<USERNAME>/<REPOSITORY>.git (fetch)
origin git@github.com/<USERNAME>/<REPOSITORY>.git (push)
upstream git@github.com/san-kumar/<REPOSITORY>.git (fetch)
upstream git@github.com/san-kumar/<REPOSITORY>.git (push)
Pull from upstream to stay up to date with what others might be doing in this repository. Any merge conflicts that arise are your responsibility to resolve.
$ git pull --rebase upstream master
Do your magic and make your fix. I can't help you with this 😉. Once you're happy with the result and all tests pass, go ahead and push to your feature branch.
$ git push origin <BRANCH_NAME>
Now, let's head back over to this repository on GitHub and submit the pull request!