Getting Started with GitHub

GitHub lets you create a free public repository (repo) where you can store and update files for public access, keeping a record of changes made over time. Although designed for version control of open source software projects, you can use it to keep track of just about anything, including Open Education Resources (OER). All free repos provide read access for their content to the entire world.

Configure your Account and Computer

Create an account for yourself at github.com. If you are going to work with an organization, like the CEEA OER SIG, ask the administrator to add your GitHub id to the organization. Complete the intro exercise to create and then modify a repo.

Download and install the GitHub Desktop App for your computer. Run it for the first time and link it to your GitHub account. This will enable you to maintain local copies of a repository on your own computer and update them as needed.

Add a License to your Repo

A license is important, giving explicit permission for your intended audience to use your materials.

Follow the instructions to create LICENSE.md file in the root of your repo. Pick a license from their options, or choose another license like Creative Commons by pasting the CC html text into the license file.

Clone your Repo on your Own Computer

To work on your own computer you will need a clone of your repository. Select “Clone or Download” and choose “Open in Desktop”. Choose where to store the cloned copy on your computer.

Make whatever changes need to be made on the local clone in your file system using the appropriate applications like editors, or whatever opens that file type.

Commit the changes to the appropriate branch in the Desktop App with appropriate messages, then push to the origin to update the version on the GitHub server.

Add Collaborators

Until you add collaborators, nobody else will be able to push content into the repository or approve pull requests.

Proposing Changes to Somebody Else’s Repo

Find the repo on GitHub and fork a copy of it to your own account. The forked version is now yours to update just as if you had created it from scratch. Make whatever changes you plan to make and commit them (either online, or locally with the desktop app and then pushed to online), then initiate a pull request for the original repo. Once your pull requested changes have been merged into the original, you can delete your fork.

You can catch up with new commits to the original by creating a pull request in your repo with the original as the source, then merging that request into your repo. This is mostly an issue when you want to merge changes made in source code by others. The mechanics of doing this in a browser can be a little confusing. From your repository click compare, then switch the base repository to your repo, then click compare across forks, then choose the original as the head repository. The order of operations is important. Now click create pull request to pull the changes from the original, open the pull request, and merge the changes into your forked version.

Reverting Commits

If you changed your mind you can back up by going to the history tab in the desktop app, right-clicking and choosing to revert the commit. Probably best to start with most recent first as you go backwards.

Organization Repos

Members of an organization like https://github.com/ceea-aceg-oer-sig get default write access to all the organization’s repos. To give slightly less trusted individuals write access to a single repo, make them collaborators on that repo instead of members of the organization. In general, better to leave third parties to propose changes by the fork-change-pull request process and retain full control inside the trusted group. (Write access means people can change or delete anything in the repo!)

License

Icon for the Creative Commons Attribution-ShareAlike 4.0 International License

Rick's Measurement for Mechatronics Notes Copyright © 2019 by Rick Sellens is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, except where otherwise noted.

Share This Book