This document summarizes the general guidelines for contributing to this project.
Every developer should follow the following workflow when contributing to the project:
To setup your environment, clone the team's repository:
$ git clone [email protected]:CarND-EuroBots/CarND-Capstone.git
To add some changes to the repository, follow these steps:
-
Go to the cloned repository from the previous step:
$ cd CarND-Capstone
-
Go to the master branch:
$ git checkout master
-
Create a new branch for your changes:
$ git checkout -b <my_branch>
NOTE: always create a new branch for your changes. Keep one branch per change; do not mix different changes in the same branch.
-
Make changes.
-
Add changes:
$ git add <files that changed>
-
Commit them:
$ git commit
NOTE: see the
Commit messages
section below on how to write a valid commit message. -
Push your changes:
$ git push origin <my_branch>
-
From the GitHub user interface, click on
New Pull Request
from<CarND-Eurobots/CarND-Capstone:<my_branch>
to<CarND-Eurobots/CarND-Capstone:master
. -
Repeat steps from 4 if you wish to add more changes.
NOTE: do not edit or squash your commits.
-
Wait until the Travis job validates your changes.
-
Wait until someone reviews your PR, especially if you are modifying other person's code.
-
Merge pull request and delete branch.
To get changes from the team's contributors, simply run:
$ git pull origin master
To get changes from Udacity, follow these steps:
-
Add Udacity's repository as a remote:
$ git remote add upstream https://github.com/udacity/CarND-Capstone.git
-
Go to your master branch:
$ git checkout master
-
Pull the changes from
upstream
:$ git pull upstream master
-
Fix merge conflicts, if any.
-
Push these changes to the team's repository:
$ git push origin master
If possible, create small, focused pull requests with small changes, in order to speed up the code-review process.
Changes should, if possible, be under 100 lines of code.
The commit message must fulfill the seven rules of a great Git commit message:
-
Separate subject from body with a blank line.
-
Limit the subject line to 50 characters.
-
Capitalize the subject line.
-
Do not end the subject line with a period.
-
Use the imperative mood in the subject line. The commit message should fit in the sentence:
This commit will <commit_message>
-
Wrap the body at 72 characters.
-
Use the body to explain what and why, not how.
We are currently using pycodestyle
to check our Python code style, and
it's verified in our Travis CI system.
Before pushing your code, make sure you pass the code style check by running:
$ python pyjobs/pycodestyle.py