-
Notifications
You must be signed in to change notification settings - Fork 4
Contributing
Before you're able to make any contributions to our website, let's make sure you have your environment set up.
- Clone source code onto your machine in a directory of your choice
git clone https://github.com/DavisCSClub/daviscsclub.org.git
- For all commands, unless otherwise stated, we will assume you are working in the root directory of your project. That is, after cloning, you run
cd daviscsclub.org
Any and all changes to the code base will require an issue to be linked, no matter how small. Bug fixes should be associated with an issue, feature additions should be associated with an issue, etc etc.
When you pick up an issue, follow these steps to properly bring it to production:
-
If you are not assigned to the issue already, go ahead and assign yourself. You can find a list of open issues here.
-
From the project root, create a new branch off of master with proper naming convention
{GITHUB-USERNAME}-{ISSUE-NUMBER}-{ShortDescription}
.
-
GITHUB-USERNAME
is your GitHub username -
ISSUE-NUMBER
can be found from the issues page, and -
ShortDescription
is a short description of the issue in camel casing. -
To check your current branch you can run
git branch -a
You should see a *
next to the current branch you're on. If you're not on master, check it out and make sure it's up to date.
git checkout master
git pull
- Finally, create a new branch for the issue by running
git checkout -b {GITHUB-USERNAME}-{ISSUE-NUMBER}-{ShortDescription}
If my github username is bryngo
and I'm picking up issue #4
that removed an item from a navigation bar, I would run
git checkout -b bryngo-4-NavBarFix
-
Make your changes! This step implies testing / QA. QA processes/testing have yet to be determined at the time of writing this. It is assumed that the individual working on the issue has enough knowledge to thoroughly test their changes.
-
When you're done with your changes, push your changes upstream.
Make sure you are on your working branch at this point. To extend the earlier example, I would run git branch -a
and make sure it tells me I am on branch bryngo-4-NavBarFix
. Then run
git add .
git commit -m "enter a useful commit message here"
git push -u origin bryngo-4-NavBarFix
- Once your branch is upstream, merge your changes into dev.
As of now, the develop
branch does not really serve any real purpose, but eventually we should have a production build, along with a dev build that reflects code from their respective branches. So for now, we'll simply be practicing good habits.
- To merge your changes into dev, make sure you are first on the develop branch, and it's up to date.
git checkout develop
git pull
- merge your changes and then push upstream
git merge --no-ff {GITHUB-USERNAME}-{ISSUE-NUMBER}-{ShortDescription}
git push
Again, and example call would be
git merge --no-ff bryngo-4-NavBarFix
git push
- Once your changes on dev are thoroughly tested (again, this testing on dev does not actually happen as we don't have a dev build set up, but follow these steps anyways), push your changes to production.
- Make sure you are on the
master
branch, and it's up to date
git checkout master
git pull
- Merge your changes into master and then push it.
git merge --no-ff {GITHUB-USERNAME}-{ISSUE-NUMBER}-{ShortDescription}
git push
- Done! Your changes should reflect on our production site! We use netlify to run our builds (which are triggered by pushes to production). Please contact any of the officers/members of this tech team for any further questions. Happy coding!
TL;DR
- Assign yourself an issue.
- Branch off with the
{GITHUB-USERNAME}-{ISSUE-NUMBER}-{ShortDescription}
naming convention. - Do your changes and QA / test.
- Push your branch upstream.
- Merge + push your branch into dev.
- Merge + push your branch into prod.
- Results. Netlify is our host, auto builds on changes to master branch.