Skip to content
Daniel Chen edited this page Feb 23, 2016 · 3 revisions

Please ask questions if you need help!

https://github.com/hackdartmouth/hackdartmouth.github.io If you do not have push access to the git repo, ping Emma

cd to a directory where you want to do development

git clone https://github.com/hackdartmouth/hackdartmouth.github.io.git
git checkout staging

From here you can view the current version of the new site by opening index.html

You can view the branches of the repo using:

git branch

Main branches (don’t push to these)

  • master. Contains the version of the site which is live at hackdartmouth.io, which we don’t want to push to until we know what we’ve developed is good
  • staging. Contains the version of the site which we are developing. Will eventually merge into master.

To begin developing a new feature or fixing something on staging, you will want to create a new branch off of staging. To do that, first make sure you are on the staging branch:

git checkout staging

Then checkout a new branch off of staging

git checkout -b NAME_OF_BRANCH

A branch name could be something like this: name/feature_you_are_working_on So, I would make something like daniel/add_dali_lab_to_sponsors

To commit changes to your branch

git add .
git commit -m “YOUR COMMIT MESSAGE”
git push origin NAME_OF_BRANCH

Once you have finished developing on your branch, and you would like to move it to staging, commit and push all of your changes to your branch and go to https://github.com/hackdartmouth/hackdartmouth.github.io and create a pull request TO STAGING.

Full Example

Here is a full example of me making a change and creating a pull request.

git checkout staging
git checkout -b daniel/set_up_staging

After making some code changes I’m happy with...

git add .
git commit -m “set up staging”
git push origin daniel/set_up_staging

Now, I go to https://github.com/hackdartmouth/hackdartmouth.github.io and I see this:

I press the “Compare & Pull Request” button

I want to create the Pull Request against the staging branch, so I need to change the drop down on the following page:

After doing that and filling in a description I am happy with, I press the “Create pull request” button.

Then you’re finished! Someone will come along to review your code and merge it to staging.

Clone this wiki locally