Author: Mike Wood, Megan Sharkey
Hi Mike! -Lucy
The is an example repository to show some Git/Hub tools during the GRISO workshop.
GitHub repositories can be used for a variety of purposes! Here are a few examples of public repositories:
- Example of modeling source code: MITgcm
- Example of a software package: diagnostics_vec (by Mike Wood)
- Example of a project to support a publication: sermilik_gridded_hydrography (by Aurora Roth)
- Example of notebooks to generate a "book": ocean_modeling_book (by Mike Wood, see book HERE)
To get code from someone's repository, there are a few options:
-
Download a zipped file of the repository.
You can do this by clicking on the big green Code button available on the repository page. Here, you will see an option for "Download ZIP"
-
"Clone" the code using command line tools
On your command line (e.g. Terminal on Mac, Git Bash on Windows), you can use the command
git pull git@github.com:repository_name.git. This option is advantangeous when the author of the original code makes regular updates to the code base because you can repeat thegit pullcommand to update your version of the code with your local version. -
"Fork" the code on GitHub
This option is similar to the previous option but it will create a copy of the code base in a new repository on your account. This option is typically undertaken when you plan to make updates to the code base but need a separate working version for testing your changes.
Github repositories are easily created using the web GitHub web interface. Some pointers on setting up repository can be found HERE.
There are two options for managing your repository - the command line or the GitHub Desktop app.
If you'd like to use the command line, the best way to push and pull changes are with ssh keys. To set up ssh keys for your repository, follow the instructions HERE.
If you'd like to use the Desktop App, you can download it directly here: https://desktop.github.com/download/