We welcome pull requests from Free Code Camp campers (our students) and seasoned JavaScript developers alike! Follow these steps to contribute:
-
Find an issue that needs assistance by searching for the Help Wanted tag.
-
Let us know you are working on it by posting a comment on the issue.
-
Read all the guidelines in this document before you start working on the issue.
If you find a bug that is not listed as an issue, feel free to add a new issue.
- Prerequisites
- Forking the Project
- Setup meeting-for-good
- Create a Branch
- Setup Linting
- Make Changes
- Creating a Pull Request
- Submitting a Pull Request
- Next Steps
Prerequisite | Version |
---|---|
MongoDB | ~ ^3 |
Node.js | ~ ^8 |
Git |
You'll need to have the latest verison of node.js installed. Either use your OS's package manager or follow the installation instructions on the official website.
This app uses MongoDB as its database engine. Follow the instructions to install it locally.
If Node or MongoDB is already installed in your machine, run the following commands to validate the versions:
node -v
mongo --version
If your versions are lower than the prerequisite versions, you should update.
- Go to the top level meeting-for-good repository page on github: https://github.com/freeCodeCamp/meeting-for-good
- Click the "Fork" Button in the upper right hand corner of the interface (More Details Here)
- After the repository has been forked, you will be taken to your copy of the meeting-for-good repo at
yourUsername/meeting-for-good
- Open a Terminal / Command Line / Bash Shell
- Clone your fork of meeting-for-good
git clone https://github.com/yourUsername/meeting-for-good.git
This will create a directory meeting-for-good
and download the entire meeting-for-good repo to it.
- Change directory to the new meeting-for-good directory (
cd meeting-for-good
) - Use the git command to add a remote to the official meeting-for-good repo:
git remote add upstream https://github.com/freeCodeCamp/meeting-for-good.git
Congratulations, you now have a local copy of the Meeting for Good repo!
Now that you have a copy of your fork, there is work you will need to do to keep it current.
Do this prior to every time you create a branch for a pull request:
- Make sure you are on the
development
branch
$ git status On branch development Your branch is up-to-date with 'origin/development'.
If your aren't on
development
, resolve outstanding files / commits and checkout thedevelopment
branch
$ git checkout development
- Do a pull with rebase against
upstream
$ git pull --rebase upstream development
This will pull down all of the changes to the official development branch, without making an additional commit in your local repo.
- (Optional) Force push your updated development branch to your GitHub fork
$ git push origin development --force
This will overwrite the development branch of your fork.
Please follow the steps in the README.md document.
Before you start working, you will need to create a separate git branch specific to the issue / feature you're working on. You will push your work to this branch. Do not work off the development branch.
Name the branch something like fix/xxx
or feature/xxx
where xxx
is a short description of the changes or feature you are attempting to add. For example fix/email-login
would be a branch where you fix something specific to email login.
To create a git branch on your local machine (and switch to this branch):
$ git checkout -b [name_of_your_new_branch]
and to push to GitHub:
$ git push origin [name_of_your_new_branch]
If you need more help with branching, take a look at this.
We reccomend you have ESLint running in your editor. It will highlight anything that doesn't conform to our meeting-for-good's coding style conventions. (you can find a summary of those rules here).
You can also check for linting errors by running the command
npm run lint
Please do not ignore any linting errors, as they are meant to help you and to ensure a clean and simple code base.
This bit is up to you! After you make changes be sure to fix any lint warnings or errors before submitting a pull request.
A pull request (PR) is a method of submitting proposed changes to a GitHub repository. You will make changes to copies of the files which make up meeting-for-good in a personal fork, then apply to have them accepted by meeting-for-good proper.
Take away only one thing from this document, it should be this: Never, EVER
make edits to the development
branch. ALWAYS make a new branch BEFORE you edit
files. This is critical, because if your PR is not accepted, your copy of
development will be forever sullied and the only way to fix it is to delete your
fork and re-fork.
- Perform the maintenance step of rebasing
development
. - Ensure you are on the
development
branch usinggit status
:
$ git status
On branch development
Your branch is up-to-date with 'origin/development'.
nothing to commit, working directory clean
-
If you are not on development or your working directory is not clean, resolve any outstanding files/commits and checkout development
git checkout development
-
Create a branch off of
development
with git:git checkout -B branch/name-here
Note: Branch naming is important. Use a name likefix/short-fix-description
orfeature/short-feature-description
. Review the Contribution Guidelines for more detail. -
Edit your file(s) locally with the editor of your choice
-
Check your
git status
to see unstaged files. -
Add your edited files:
git add path/to/filename.ext
You can also do:git add .
to add all unstaged files. Take care, though, because you can accidentally add files you don't want added. Review yourgit status
first. -
Commit your edits:
git commit -m "Brief Description of Commit"
. Do not add the issue number in the commit message. -
Squash your commits, if there are more than one.
-
Push your commits to your GitHub Fork:
git push -u origin your-branch-name
-
Submit a Pull Request
-
Once the edits have been committed, you will be prompted to create a pull request on your fork's GitHub Page.
-
Submit a pull request from your branch to FreeCodeCamp's meeting-for-good
development
branch. -
The title (also called the subject) of your PR should be descriptive of your changes and succinctly indicates what is being fixed.
-
Do not add the issue number in the PR title or commit message.
-
Examples:
Add Test Cases to Bonfire Drop It
Correct typo in Waypoint Size Your Images
-
-
In the body of your PR include a more detailed summary of the changes you made and why.
- If the PR is meant to fix an existing bug/issue, then, at the end of
your PR's description, append the keyword
closes
and #xxxx (where xxxx is the issue number). Example:closes #1337
. This tells GitHub to close the existing issue, if the PR is merged.
- If the PR is meant to fix an existing bug/issue, then, at the end of
your PR's description, append the keyword
Once your PR is accepted, you may delete the branch you created to submit it. This keeps your working fork clean.
You can do this with a press of a button on the GitHub PR interface. You can
delete the local copy of the branch with: git branch -D branch/to-delete-name
Don't despair! You should receive solid feedback from the moderators as to why it was rejected and what changes are needed.
Many Pull Requests, especially first Pull Requests, require correction or updating. If you have used the GitHub interface to create your PR, you will need to close your PR, create a new branch, and re-submit.
If you have a local copy of the repo, you can make the requested changes and
amend your commit with: git commit --amend
This will update your existing
commit. When you push it to your fork you will need to do a force push to
overwrite your old commit: git push --force
Be sure to post in the PR conversation that you have made the requested changes.