From b15f66c47f6d41705f2439d0f2267e96610fa6fa Mon Sep 17 00:00:00 2001 From: Timothy Middelkoop Date: Tue, 4 Jun 2024 06:48:43 -0500 Subject: [PATCH] Expand and refine Git materials --- Notes.md | 31 +++++++++++++++++++++++++------ ReadMe.md | 9 +++++---- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/Notes.md b/Notes.md index 7579945..f32f0f8 100644 --- a/Notes.md +++ b/Notes.md @@ -13,7 +13,7 @@ * Username: Enter username (your_name), which is the same as the first part of your your_name@skc.edu email address. * Click on "Complete Account" (you may need to click on "Leave") * Set a password: - * Click your avitar (colorful box in the top right) for a dropdown box + * Click your avatar (colorful box in the top right) for a dropdown box * Click "Settings" in the dropdown box * Click on "Account" tab on the left * **DO NOT USE YOUR SKC PASSWORD HERE!** @@ -22,7 +22,7 @@ * Create new repo: * Click the"+" in the upper right and select "+ New Repository" * Repository Name: skc-your_name - * Make repository private (Visiblity): check the checkbox + * Make repository private (Visibility): check the checkbox * Initialize Repository: check the checkbox * Click "Create Repository" * Navigate to your repo: @@ -49,7 +49,7 @@ * Under "Workspace" * Set "Restore .RData into workspace at startup" to "No" * Set "Save workspace to .RData on exit" to "No" - * Set "Always save histroy" to "No" + * Set "Always save history" to "No" * Click "Ok" * Setup Git * This needs to be done only once when you create a "new project". @@ -111,7 +111,7 @@ git config --local --list * Enter the username and password for the Git repo (not your account) * Make sure there is not an error * Verify push - * Click "Push" again and make sure it says "Everyting up-to-date" + * Click "Push" again and make sure it says "Everything up-to-date" * Close git window * Verify commit: * Click "Commit" under the *Git menu* @@ -122,14 +122,14 @@ git config --local --list * Move Terminal and Console pane to the right * "View" -> Panes -> Console on Right -## Quit Envrionment +## Quit Environment * Git Commit: (see above) * Shutdown RStudio: "File" -> "Quit Session" * Shutdown Jupyter: "File" -> "Hub Control Panel" -> "Stop My Server" * Close all Jupyter and RStudio windows -## Start Envrionment after Setup +## Start Environment after Setup * Navigate to https://ci.skc.edu/ and click "Login to OSG Jupyter Notebook" * Start Jupyter: Select "Data Science with RStudio" and click "Start" @@ -194,6 +194,25 @@ git fetch git status ``` +### Git Workflow + + * Fetch any changes from the remote repository (Gitea): `git fetch` + * Check the status of your repository: `git status` + * If there are changes from the remote repository: + * See what changed: `git log origin` and `git diff origin` (more detail) + * Merge the changes: `git merge` + * Do work and edit your files + * Find a logical spot to stop and commit (save) + * See what changed: + * `git status` + * `git diff` + * Stage files (index): `git add file.txt` + * Double check that nothing has been added to the remote repository: `git fetch` + * Check the status: `git status` + * Commit changes: `git commit` (write a good commit title and message!) + * Push the changes to the remote repository: `git push` + * Rest + ### R Configuration R packages must be installed every time the environment is started, to do this a `setup.R` script or a R Markdown document must be run with the following: diff --git a/ReadMe.md b/ReadMe.md index cf3add5..2ee694d 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,6 +1,6 @@ # SKC CI Workshop June 2024 -*"If it's not Reproducible, it's Magic"* +*"Getting started with Cyberinfrastructure"* ## Lessons @@ -18,8 +18,8 @@ Lessons (Day 2): * Welcome and overview * Sharing & collaborating with code (Github introduction) - * Introduction: https://happygitwithr.com/big-picture.html * https://swcarpentry.github.io/git-novice/01-basics.html + * Motivation: https://happygitwithr.com/big-picture.html (extra background) * https://swcarpentry.github.io/git-novice/04-changes.html * https://swcarpentry.github.io/git-novice/05-history.html * https://swcarpentry.github.io/git-novice/06-ignore.html @@ -34,17 +34,18 @@ Lessons (Day 2): * Login to the environment (SKC-CARE): https://ci.skc.edu/ * Instructor Notes: [Notes.md](Notes.md) * Git and R (recommended for students and as a teaching resource): https://happygitwithr.com/ + * Introduction: https://dx.doi.org/10.7287%2Fpeerj.preprints.3159v2 * R Markdown: https://bookdown.org/yihui/rmarkdown/markdown-syntax.html * Git book: https://git-scm.com/book/en - * Git branching: + * Git branching: * https://happygitwithr.com/git-branches (and remotes https://happygitwithr.com/git-remotes) * https://nvie.com/posts/a-successful-git-branching-model/ * https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell * R Tutorial: https://www.cyclismo.org/tutorial/R/ * R project introduction http://cran.r-project.org/doc/manuals/R-intro.html * R Language: https://www.r-project.org/ - * Test Driven Development (TDD) http://www.agiledata.org/essays/tdd.html ### Advanced Materials * Git internals: "Git for Ages 4 And Up" - https://youtu.be/1ffBJ4sVUb4 + * Test Driven Development (TDD) http://www.agiledata.org/essays/tdd.html