Skip to content

Latest commit

 

History

History
66 lines (57 loc) · 2.95 KB

gettingStarted.md

File metadata and controls

66 lines (57 loc) · 2.95 KB

Getting Started with GitHub

Table of contents

Using Github

  • Some tasks can be performed on https://github.com/ :
    • Can be useful for adding files directly to a repository
    • Pull requests (more below)
    • Create/open issues
    • Editing code directly

Downloading GitHub Desktop

  • Download GitHub Desktop: https://desktop.github.com/
  • Install locally on your computer or via Remote Desktop through Horizon
  • Note: Conducting analyses requires the J:/ Drive. Therefore, this will typically require GitHub to be installed via Remote Desktop through Horizon

Getting Started

  • Login using your account information from GitHub.com
  • Your repositories should now be visible
  • Highlight the repository you're going to work on and click 'Clone'
    • Specify a path where you want this repository to be stored on your computer
    • This will copy the current contents of the repository to your computer

Example Workflow

  • Clone a repository to your computer
  • Create a branch to work on your code
  • Commit changes you make on your branch and push these to Github
  • If files are updated you can pull to get the most up-to-date files
  • Once finalised you can open a pull request
  • Finally you merge your changes to the Master branch and delete the branch

GitHub Terminology

  • Clone
    • Copies a repository locally to your computer
  • Master branch
    • Where the finalised and up to date files are stored
  • Branch/brancing:
    • Create a branch off the Master branch to work on prototype code
  • Commit:
    • You can commit (save) to the Master branch directly (not recommended when iterating code)
    • Save changes you make to your branch (useful to have sensible commit messages)
  • Pull Request:
    • When you are happy with the code you've worked on in your branch you can have it reviewed against the Master branch
    • You can nominate collaborators as reviewers and they can comment changes or directly provide suggested edits for your code
    • These can be run iteratively to develop a finalised version
  • Merge your pull request:
    • This now synchronises your branch with the Master branch
    • You can then delete the branch, since its changes have been incorporated
  • Push:
    • A push will sync changes made locally to the relevant branches on Github.com
  • Pull:
    • A pull will download updates to this repository (made by others) from Github.com

Learning Resources

  • Quick start guide here
  • An introductory course here
  • GitHub Desktop guide here