-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path03-handson_github_workflows.qmd
91 lines (57 loc) · 3.26 KB
/
03-handson_github_workflows.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
---
title: "GitHub workflows: forks and branches"
---
### Setup
#### Person 1 (owner):
- Create a repository using the following these [instructions](https://docs.github.com/en/github/getting-started-with-github/create-a-repo) steps 1-6
![](img/github-dessert-repo.png)
- Add Person 2 as collaborator following these [instructions](https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/inviting-collaborators-to-a-personal-repository)
- Edit the README to:
- Replace the title (first line starting with `#`) with something better! Maybe `Favorite Desserts`
- Add your name and your favorite dessert below the title: e.g. ` - Julien: crepes`
```{r}
knitr::include_graphics("img/github-readme_desserts.png")
```
### Forks
#### Person 2: Create a Fork
- Ask your teammate to Slack you the link to the repository
- Create a Fork by clicking on the Fork button on the top right view of your repository homepage
```{r fork-button, out.width="60%", echo=FALSE}
knitr::include_graphics("img/github-fork-button.png")
```
- On your Fork, start editing the `README.md`
- Add your name and your favorite dessert below your teammate entry: e.g. ` - Sophia: chocolate`
- Add a descriptive commit message
```{r}
knitr::include_graphics("img/github-commit.png")
```
- Commit your changes
```{r commit-button, out.width="20%", echo=FALSE}
knitr::include_graphics("img/github-commit-button.png")
```
- Create a pull request to merge those changes to the main repository using these [instructions](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
#### Person 1:
- Go to *your* repository and merge the PR
---
### Branches
#### Person 1: add a file
Download this [csv file](https://aurora.nceas.ucsb.edu/~brun/favorite_desserts.csv) about your favorite desserts to your computer
- Just drag and drop it on the Github web page of your repository to upload it
- Add a short message about the file: e.g. `Adding dessert csv` & hit `Commit changes`
- Your file has been uploaded. Click on the filename to see it!
You should have something similar to this repo: <https://github.com/brunj7/favorite-desserts/blob/master/favorite_desserts.csv>
Now you want to collaborate more closely and do not wan your teammate to have to create a fork and be able to work directly on your repository
- Add Person 2 as a collaborator following these [instructions](https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/inviting-collaborators-to-a-personal-repository)
#### Person 2: Create a branch
- Check your email or Github Notifications to accept the invitation
- Go to the repository website (link is provided in the invitation)
- Create a new branch named after your first name
```{r}
knitr::include_graphics("img/github-create_branch.png")
```
- Edit the csv file directly on GitHub to add your favorite dessert to it
- Create a **P**ull **R**equest (PR) to merge you branch back to main
- Assign person 1 as a reviewer ([instructions](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review))
#### Person 1: Merge the branch
- Review PR
- Merge and close PR