# Introduction to GitHub

Before next lab session, you should have the following completed

1.  R/Rstudio downloaded
2.  Git/GitHub downloaded
3.  GitHub shared with me
4.  R/Rstudio and Git/GitHub integrated
5.  GitHub repo organized

In order to complete the task "GitHub repo organized" and begin understanding how to use Git, complete this worksheet before next lab.

## Activity 1

1.  Edit your `README.md` *on your computer* in Rstudio by deleting all the text in the file and then replacing it with `# BISC 404L: Ecology and Biodiversity`. Be sure to save these changes, if saved correctly the filename in Rstudio should change from red to black.
2.  Commit your changes with a descriptive message

Go to your repo on your browser, what do you observe?

```         
```

Paste a screenshot of what you see (*to paste in screenshots, be sure to be viewing the `.qmd` in "Visual" mode*)

*Screenshot:*

3.  On your computer, push your changes

Go to your repo on your browser, what do you observe now?

```         
```

*Screenshot:*

4.  Edit your `README.md` online in the browser by adding your name surrounded by one asterisk (\*) on each side on the line underneath "BISC 404L..."
5.  Commit your changes with a descriptive message

Go to the folder on your computer containing your repo, what do you observe?

```         
```

*Screenshot:*

6.  Pull your changes to your local device

Go to the folder on your computer containing your repo, what do you observe now?

```         
```

*Screenshot:*

7.  On your computer, create a new file called `test1.txt`
8.  Edit your `.gitignore` file to include the name `test1.txt` at the bottom of the `.gitignore` file

Now what happens when you try to commit and push your changes your changes? What do you see in your browser versus on your computer?

```         
```

*Screenshot:*

9.  On your computer, delete `test1.txt` from your `.gitignore` file. Now what happens when you try to commit and push?

```         
```

*Screenshot:*

10. On your computer create a new, empty folder in your repo called "test_folder".

What do you observe on your browser when you try to commit and push?

```         
```

*Screenshot:*

11. Now add a file called `test2.txt` inside your folder "test_folder"

Now what do you observe on your browser when you try to commit and push? Why did it change?

```         
```

*Screenshot:*

12. On your browser, edit the `test2.txt` by writing the word "green" in it

13. Commit

14. On your desktop, edit the `test2.txt` by writing the word "blue" in it

15. Commit

Now what do you observe when you try to push from your computer?

```         
```

*Screenshot:*

Why is that?

```         
```

16. On your computer, go into test2.txt. You should see that the file has changed.

What do you think these new symbols mean?

```         
```

*Screenshot:*

17. Delete all the text in the file except for "green" and commit

Now what do you observe when you try to pull from your browser?

```         
```

*Screenshot:*

## Activity 2

Take time to better organize the folder/file structure of your repo

-   Here is a template format you can use:

    -   ![](images/clipboard-3401715733.png){width="264"}

    -   [Template Repository](https://github.com/CharlesLehnen/standard_repository_template)

-   You can also follow a template like this for coursework:

    -   ![](images/clipboard-828242083.png){width="162"}

-   Or you can make whatever folder structure makes sense to you, as long as it is intentional and logical

::: callout-warning
## GitHub Warnings!

-   **Note:** GitHub does *not* like empty folders

-   GitHub does not do well with large files. Best to add them to `.gitignore` and back them up separately (Google Drive, OneDrive, etc.)
:::

## Activity 3

Underneath the course title and your name, on your computer add whatever descriptive text you would like to your `README.md` file. You could add a description of your folder structure, you could start a list talking about which topics we covered in which labs, you could start a documents folder and download the course syllabus to it, etc.

For inspiration, you could look at [this README.](https://github.com/CharlesLehnen/standard_repository_template/blob/main/README.md)

Add some style to your README following this guide:

![](images/clipboard-1482354080.png)\
[*Source*](https://lukegearing.blot.im/using-markdown-and-pandoc-to-make-rpg-documents-for-free)

*To add styles using this guide, be sure to be viewing this `.qmd` in "Source" mode. You can toggle to "Visual" mode to double check that style changes are being made as you intend.*

![](images/clipboard-561899689.png)
