Github
What GitHub is for
GitHub is web-hosted source code repository that uses git. Think of it as a file system, with the ability to retrieve past versions of files. You work on local versions of the files. When you want to keep a version of files you’ve changed, you commit your changes, and the changes are stored in a local databse. When you want your committed changes to be stored on the web, you sync with GitHub.
How we use GitHub
Writing code based on an existing repo
Most of the time we are using GitHub to support code development. There are several ways you can get this code:
Forking and cloning
If you intend to submit your changes for inclusion in the master copy:
-
From the home page of the project you intend to fork (e.g.umich-quant), click the fork button in the upper right. This creates a linked copy of the project in your personal repository.
-
Using the GitHub Desktop client, or from the home page of your newly forked repo, clone the forked repo. Now you can start coding.
-
When you are ready to submit your changes, first commit and sync. Then do a pull request from GitHub Desktop.
-
If you change your mind, and decide you don’t want your changes, you can delete your local (cloned) repo, and from the website, delete the forked repo.
Directly cloning
If you just want to get a complete copy of the code, and don’t intend to submit changes to the the original repo via a pull request, then you can just directly clone the repo. From the home page of the project you intend to fork (e.g.umich-quant), click the clone button in the upper right. This will direct you to GitHub Desktop.
Copying and pasting
Often we may only be working with a couple of files. If you only want to use those files, you can copy and paste from the original repo (e.g. umich-quant).
Website development
We use GitHub for maintaining personal websites (e.g. pbenson.github.io). These websites always have URLs of the form githubusername.github.io.