This repository should intentionally remain as a private repo, so therefore is not published on an external github.io page. Upon following the instructions below, the repo will automatically run integration tests, spelling checks and page building tests.
The only folders and files therein which need to be edited for lesson use are as follows;
_episodes/
orepisodes_rmd/
: Episodes either in regular Markdown or RMarkdown_includes/snippets_library/
: Including code snippets (text files, outputs etc.) This is for convenience, as it can be easily written in markdown_config.yml
: As above, specific commands/abstractions which can be usedfig/
: Insert figuresdata/
: Any data needed for the duration of the lessonslides/
: Any powerpoint/pdf slides being used for the lessonfiles
,code
: Can be utilised as above subject to content
Any files which are not included in the above should be tested in the ichec-template
repository before continuing.
To create a new repository from this template and to ensure you have your own copy, follow the instructions outlined below:
- Select Use this template
- Select ICHEC-learn as the owner then call the repo something memorable (e.g. intro-to-linux), and give a description (can be edited later)
- Set to Public and make sure the final Include all branches is NOT unticked.
- The new repo will be created and the tests will run automatically.
- Enable
github.io
page building through Settings -> Pages. You may need to set the theme first time. The theme choice will not matter as it will be forced into the Carpentries style. - Copy the link and paste into About, on the right hand side of the main page.
- Next head up to Fork, which allows you to freely experiment with the repo in your own account without affecting the original project.
- From here you can now work on Github online or locally (via cloning). Repeat steps 5 & 6 from the previous to have your own publishable github.io page.
Working Online/Locally
- Online: Upon editing the file it needs to be committed, similar to saving. Ensure you commit to the
gh-pages
branch. NB: If there are other contributors, ensure that on your forked repo, you click Fetch upstream regularly. - If you are creating a local copy on your machine;
a) Head to the Code button and copy the link, then clone locally by typing
git clone mylink.git
b) Edit as normal, to commit changes; -git add myfile
-git commit -m "my changes"
c) To push your local changes to git, simply typegit push
d) NB: If changes have been made by others and you have fetched on your forked repo in github (step 1 above), ensure you typegit fetch
to merge your local laptop changes with your forked online repo (which has been synced with the ICHEC-learn main repo)
________________________________________________________________________
| |
| Remote ICHEC-learn/lesson-repo |
| | ^ |
| | | |
|---------------------------------------v----------------|--------------|
| Fetch upstream Merge Requests |
|---------------------------------------|----------------|--------------|
| | v | |
| Local (fork) | Online username/lesson-repo |
| | | ^ |
| |---------------v----------------|--------------|
| | `git fetch` `git push` |
| |---------------|-------------------------------|
| | Laptop | `git commit` |
| | | ^ |
| | v | |
| | `/path/to/lesson-repo` |
|_______________________|_______________________________________________|
To merge your changes with the main ICHEC-learn;
- On your forked repo,
{yourusername}/{repo-name}
head to the top bar and select Pull requests - Head to the right and select New pull request
- On the next screen, check it is able to merge and Create pull request
- Fill in the Title of your pull request (Comments below are optional but recommended for reviewers) and then Create pull request
- Wait for the tests to finish (~5 mins) at which point, the All checks have passed message will appear and;
- contact a fellow colleague working on the repo and ask them to review.
- or if you are the sole contributor
- Press the Merge pull request, then Confirm merge
IMPORTANT
If you are working off a repo with multiple contributions, ensure you commit and push daily
If a change has been merged to the main-repo in a file which you are working on, pull requests cannot automatically be merged, but you can still create the pull request.
You then need to head to Resolve conflicts. At this point you will need to resolve the areas where >>>>>>>>>>gh-pages
and
========
is displayed, otherwise it won't be resolved. This work will not save automatically, so has to be solved in one sitting.