GitHub allows you to make changes to a project using git, and later submit them in a "pull request" so they can be reviewed and discussed. In order to use GitHub, you need to sign up and set up git. You will also need to fork the btcinformation.org repository from its GitHub page and clone your GitHub repository into a local directory with the following command lines:
git clone (url provided by GitHub on your fork's page) btcinformation.org
cd btcinformation.org
git remote add upstream https://github.com/achow101/btcinformation.org.git
How to send a pull request
- Checkout to your master branch.
git checkout master
- Create a new branch from the master branch.
git checkout -b (any name)
- Edit files and preview the result.
- Track changes in files.
git add -A
- Commit your changes.
git commit -m '(short description for your change)'
- Push your branch on your GitHub repository.
git push origin (name of your branch)
- Click on your branch on GitHub and click the Compare / pull request button to send a pull request.
When submitting a pull request, please take required time to discuss your changes and adapt your work. It is generally a good practice to split unrelated changes into separate branches and pull requests.
Travis Continuous Integration (CI)
Shortly after your Pull Request (PR) is submitted, a Travis CI job will be added to our queue. This will build the site and run some basic checks. If the job fails, you will be emailed a link to the build log and the PR will indicate a failed job. Read the build report and try to correct the problem---but if you feel confused or frustrated, please ask for help on the PR (we're always happy to help).
If you don't want a particular commit to be tested, add [ci skip]
anywhere in its commit message.
If you'd like to setup Travis on your own repository so you can test builds before opening a pull request, it's really simple:
-
Make sure the master branch of your repository is up to date with the achow101/btcinformation.org master branch.
-
Open this guide and perform steps one, two, and four. (The other steps are already done in our master branch.)
-
After you push a branch to your repository, go to your branches page (e.g. for user harding, github.com/harding/btcinformation.org/branches). A yellow circle, green checkmark, or red X will appear near the branch name when the build finishes, and clicking on the icon will take you to the corresponding build report.
How to make additional changes in a pull request
You simply need to push additional commits on the appropriate branch of your GitHub repository. That's basically the same steps as above, except you don't need to re-create the branch and the pull request.
How to reset and update your master branch with latest upstream changes
- Fetch upstream changes.
git fetch upstream
- Checkout to your master branch.
git checkout master
- Replace your master branch by the upstream master branch.
git reset --hard upstream/master
- Replace your master branch on GitHub.
git push origin master -f
Advanced GitHub Workflow
If you continue to contribute to btcinformation.org beyond a single pull request, you may want to use a more advanced GitHub workflow.