- Use only vanila js
- No external requirements
- Try to document the logic as much as possible
- Use meaningfull names for variables, functions, objects
- Ask before adding new script/feature
1. Fork the repository on GitHub and clone your fork to your development environment
git clone [email protected]:YOUR-GITHUB-USERNAME/dg-companion.git
If you have trouble setting up Git with GitHub in Linux, or are getting errors like "Permission Denied (publickey)", then you must setup your Git installation to work with GitHub
Change to the directory where you cloned your project, normally "dg-companion". Then enter the following command:
git remote add upstream git://github.com/fl0v/dg-companion.git
git pull upstream
You should start at this point for every new contribution to make sure you are working on the latest code.
That's very important
Each separate bug fix or change should go in its own branch. Branch names should be descriptive and start with 'bugfix' or 'feature' as in example:
git checkout upstream/master
git checkout -b bugfix-the-planets-list-conflicts-with-another-script
git checkout upstream/master
git checkout -b feature-message-planet-owner
Make sure it works :)
add the files/changes you want to commit to the staging area with
git add path/to/my/file
You can use the -p
option to select the changes you want to have in your commit.
Commit your changes with a descriptive commit message.
git commit -m "A brief description of this change which fixes some bug"
git pull upstream master
This ensures you have the latest code in your branch before you open your pull request. If there are any merge conflicts, you should fix them now and commit the changes again.
git push -u origin name-of-your-branch-goes-here
The -u
parameter ensures that your branch will now automatically push and pull from the GitHub branch. That means
if you type git push
the next time it will know where to push to. This is useful if you want to later add more commits
to the pull request.
7. Open a pull request against upstream.
Go to your repository on GitHub and click "Pull Request", choose your branch on the right and enter some more details in the comment box.
Note that each pull-request should fix a single change. For multiple, unrelated changes, please open multiple pull requests.
If your code is accepted it will be merged into the main branch. If not, don't be disheartened, different people need different features, but your code will still be available on GitHub as a reference for those who need it.
After your code was either accepted or declined you can delete branches you've worked with from your local repository
and origin
.
git checkout master
git branch -D name-of-your-branch-goes-here
git push origin --delete name-of-your-branch-goes-here
git clone [email protected]:YOUR-GITHUB-USERNAME/dg-companion.git
git remote add upstream git://github.com/fl0v/dg-companion.git
git fetch upstream
git checkout upstream/master
git checkout -b name-of-your-branch-goes-here
/* do your magic, update changelog if needed */
git add path/to/my/file
git commit -m "A brief description of this changee"
git pull upstream master
git push -u origin name-of-your-branch-goes-here