Skip to content

Contributor's Workflow

Torbjörn Klatt edited this page Feb 3, 2016 · 16 revisions

This assumes, you have read and followed Basic Setup.

Update Your Local Copy

Before you start editing, you should, by all means, update your local copy to contain all changes to the website added since you worked on your local copy the last time, i.e. pull the source branch from upstream.

We assume, your are in the working directory of your local copy of the JLESC website (e.g. in $HOME/projects/jlesc.github.io)

  1. Checkout the source branch:

     git checkout source
    

    In case this command fails, you have unstashed changes laying around, which you should either stash (git stash) or drop completely (git reset --hard, be careful with this command!).

    If you do not see folders like e.g. _assets, _projects, etc. (with a preceding underscore) you are probably in the master branch!

  2. Get all upstream changes:

     git fetch --all --prune
     git pull
    

    This fetches all changesets from the upstream JLESC website repository to your local copy and updates your checked out source branch to the latest upstream state.

Starting Contributions

Here we describe the recommended workflow of adding your changes to your fork and getting them into the upstream repository and finally onto the official website.

We strongly encourage everybody to follow this workflow closely!

From now on, it is assumed you are in your local copy (e.g. in $HOME/projects/jlesc.github.io) and it is up to date according to the procedure above.

  1. Create a feature branch to contain your changes.
    Chose a descriptive but short name, e.g. feature/my-latest-paper, feature/project-awesome or fix/bibtex-typos:

     git checkout -b feature/my-latest-paper
    
  2. Add new content, fix existing or add missing

    1. Make yourself familiar with Markdown and the Liquid template language used throught this project: Adding/Modifying Content.

    2. Read Adding Pages.
      If you are not familiar with markdown, just look at existing entries: It is easy.

    3. Read Adding Publications.
      Adding a new or missing publication to the list is easy as adding a BibTeX entry to the BibTeX file.

  3. Add your changes to Git and commit them as you go:

     git add -A
     git commit --signoff
    

    A text editor (defaults to $EDITOR) will open querying you to enter a short but descriptive commit message (read this link!).

  4. (optional)
    Read Testing Locally to see how you can view and test the website including your changes locally on your computer.

  5. When you are done, push your branch with your changes to your fork on GitHub:

     git push -u my_fork feature/my-latest-paper
    

    The -u flag will tell Git that the remote tracking branch of the local feature/my-last-paper branch is in the my_fork remote repository. That way, you do not have to type it out each time you update this branch. A simple git push while being on that branch locally will do.

  6. Go to the official JLESC website repository while being logged into GitHub.
    A notification should be displayed offering you to open a pull request (PR) from the branch you just pushed onto the source branch.

    In case no such notification pops up, you can create a pull request manually:

    1. Go to your fork on GitHub.

    2. Select your newly pushed branch, e.g. feature/my-latest-paper

    3. Click 'New pull request'

    4. Review the changes and formulate a descriptive pull request subject and message.
      GitHub will prefill it with a commit message.

    5. Open the Pull Request by clicking on 'Create pull request'.

  7. Wait for one of the admins to merge your PR and see your content online.

    Meanwhile, Travis will try to build the website containing your changes to ensure your changes did not break anything important.

    Also, make sure the PR on GitHub is "green" as shown in the following screenshot:

    In case your PR branch needs an update, GitHub will tell you by offering a notification and button to do so:

    Please, respond and follow any comments and remarks the admins do on your pull request.

  8. Thank you very much for your contribution! 👍