Skip to content

Commit 00d9f43

Browse files
committed
feat (github): more subheadings, more explanation, notes about GH by itself versus with an IDE (lter/scicomp#91)
1 parent d805b54 commit 00d9f43

1 file changed

Lines changed: 27 additions & 17 deletions

File tree

github.qmd

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Using GitHub"
2+
title: "Using GitHub with a Browser"
33
---
44

55
## Module Learning Objectives
@@ -32,21 +32,30 @@ Once you've logged in, you should see something like this:
3232

3333
This landing page has a nice summary of your recent repositories and activity on the left panel. Click on your icon at the top left corner and navigate to your profile.
3434

35+
### Your GitHub Profile
36+
37+
Your profile page shows the organizations that you're a part of, as well as a more detailed view of your GitHub contributions/activities over time. There are also tabs at the top that lead you to your repositories, projects, packages, and starred repositories.
38+
39+
3540
<p align="center">
3641
<img src="images/github/github-4-profile-light.png" alt="Screenshot of the landing page on a particular GitHub profile" width="100%"/>
3742
</p>
3843

39-
Your profile page shows the organizations that you're a part of, as well as a more detailed view of your GitHub contributions/activities over time. There are also tabs at the top that lead you to your repositories, projects, packages, and starred repositories. If you would like, you can change your GitHub theme to dark mode by clicking on your icon at the top left corner and going to **Settings** then **Appearances**. For the purposes of this workshop, the rest of the screenshots for the GitHub website will be in dark mode to differentiate it from RStudio.
44+
If you would like, you can change your GitHub theme to dark mode by clicking on your icon at the top left corner and going to **Settings** then **Appearances**. For the purposes of this workshop, the rest of the screenshots for the GitHub website will be in dark mode to differentiate it from RStudio.
4045

4146
<p align="center">
4247
<img src="images/github/github-5-dark-mode.png" alt="Screenshot of the 'appearance' section of a GitHub user's settings area" width="100%"/>
4348
</p>
4449

4550
If there is anything else you would like to change about your account, the user settings page should have it.
4651

47-
### Looking at a GitHub Repository
52+
## Looking at a GitHub Repository
53+
54+
To check the repositories that you've created, click on the **Repositories** tab. Note that the top left corner has a green button that will allow you to create new repositories. We will come back to that later.
4855

49-
To check the repositories that you've created, click on the **Repositories** tab. Note that the top left corner has a green button that will allow you to create new repositories. We will come back to that later. Let's take a closer look at what the ucsb-ds-capstone-2021.github.io repository contains.
56+
### Repository Content & Structure
57+
58+
Let's take a closer look at what the ucsb-ds-capstone-2021.github.io repository contains.
5059

5160
<p align="center">
5261
<img src="images/github/github-6-my-repos.png" alt="Screenshot of the 'repositories' tab of a user on GitHub" width="100%"/>
@@ -74,36 +83,37 @@ And finally, if we examine one of the changes made on April 25, we can see exact
7483

7584
The red lines have been deleted while the green lines are new additions. Tracking these changes, and seeing how they relate to released versions of software and files is exactly what Git and GitHub are good for. We will show how they can really be effective for tracking versions of scientific code, figures, and manuscripts to accomplish a reproducible workflow.
7685

77-
Note: it is possible to edit and add files entirely on the GitHub website, by navigating to the specific file or repository. However, for this workshop, we will be editing and adding files through RStudio instead.
86+
### Editing a File in GitHub
87+
88+
It is possible to edit and add files entirely on the GitHub website, by navigating to the specific file or repository. To edit an existing file, simply navigate to the file you want to edit (in GitHub), and click the pencil icon above and to the right of the file's contents.
7889

7990
<p align="center">
8091
<img src="images/github/github-10-edit-file.png" alt="Screenshot of a file being viewed in GitHub with a yellow circle around the pencil icon on the top right corner of the file. The pencil has a hovering message above it labeled 'edit this file'" width="100%"/>
8192
</p>
8293

94+
To add a file, go to the home page of the repository and click the "Add file" dropdown (just to the left of the blue "Code" button) and choose the option that fits your needs. Note that you can only make new files in the 'top level' of the repository or in an existing folder so if you need to make a new folder, you'll need to embrace using GitHub with an IDE (<u>I</u>ntegrated <u>D</u>evelopment <u>E</u>nvironment).
95+
8396
<p align="center">
8497
<img src="images/github/github-11-add-file.png" alt="Screenshot of a GitHub repository landing page where the 'add file' button has been clicked and a yellow circle surrounds the 'create new file' and 'upload files' buttons in the sub-menu that action created" width="100%"/>
8598
</p>
8699

87-
### Creating a Repository on GitHub
88-
89-
To stimulate a collaborative GitHub/RStudio workflow, we are going to have 1 person from each group create a new repository on their GitHub account. This will be the repository where everyone shares their files and code.
100+
## Creating a Repository on GitHub
90101

91-
To create a new repository, follow these steps:
102+
You can start the process of making a repository in GitHub. In fact, even if you plan on using GitHub via an IDE (e.g., RStudio, Visual Studio Code, Positron), **we recommend starting the repository in GitHub before continuing to work in your IDE of choice.**
92103

93-
- Navigate to your profile page and click on the **Repositories** tab.
94-
- Click on <span style="color:green">**New**</span>.
104+
In order to create a new repository, navigate to your profile page and click on the **Repositories** tab. Once you are there, click the <span style="color:green">**New**</span> button in the upper right corner.
95105

96106
<p align="center">
97107
<img src="images/github/rstudio-1-github-profile.png" alt="Screenshot of the 'repositories' landing page of a particular GitHub user" width="100%"/>
98108
</p>
99109

100-
- Enter a descriptive name for your new repository, here we named it `git-practice` (avoid upper case and use `-` or `_` instead of spaces).
110+
You will now be prompted to do some setup tasks before the repository can be created. First, choose a descriptive name for your new repository, here we named it `git-practice` but generally you'll want a name that is short while still being descriptive so you can identify its purpose at a glance. Also, it is good practice to avoid uppercase letters and use `-` or `_` instead of spaces.
101111

102-
- Write a 1-sentence description about the repository content.
112+
Once you've named your repository, write a 1-sentence description about the repository content. Choose **Public**–this will prevent some easily avoidable access issues down the line.
103113

104-
- Choose **Public** (as of January 2019, GitHub now offers unlimited free private repositories with a maximum of 3 collaborators).
114+
Finally, check the box next to "**Add a README file**". This will create a nice file in the top-level of the repository that you can use for high-level documentation. That is extremely useful as a home for any explanation that the repository needs in order to be intelligible to 'future you' or your collaborators.
105115

106-
- Check **Add a README file**.
116+
Note that you may want to also add a `.gitignore` using the GitHub template for the code language that you plan to use (see the dropdown menu). This file is described in greater detail elsewhere in this workshop but essentially it is a list of files and folders that you _don't_ want Git to track or that you don't want to upload to GitHub. The coding language templates mostly start by excluding machine-readable files that you don't care about but that your IDE needs to function.
107117

108118
<p align="center">
109119
<img src="images/github/rstudio-3-new-repo-edits.png" alt="Screenshot of the page on GitHub that appears when you click 'new repository'. Contains empty dialogue fields for the repository name and description as well as options for public versus private repositories among other initialization options" width="60%"/>
@@ -131,9 +141,9 @@ Click on <span style="color:green">**Add people**</span>. Now let's get the user
131141
<img src="images/github/rstudio-5b-collabs-4-added-new-user.png" alt="Screenshot of the confirmation message to add a collaborator once they've been selected based on their username or email" width="40%" />
132142
</p>
133143

134-
Great! Now everyone in the group should have access to the repository.
144+
Great! Now everyone in the group should receive an invite to access that repository. The invite expires in 24 hours so be sure to send the invite during normal working hours and consider also emailing your team members to let them know they have a time-sensitive invite in whichever email inbox is tied to their GitHub account.
135145

136-
## Create a Repository on GitHub
146+
### Practice: Create Your Own Repository
137147

138148
:::callout-note
139149
## Practice

0 commit comments

Comments
 (0)