-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01-04-git-and-github-workflow.qmd
More file actions
31 lines (26 loc) · 1.3 KB
/
01-04-git-and-github-workflow.qmd
File metadata and controls
31 lines (26 loc) · 1.3 KB
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
# Git and GitHub Workflow
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, fig.align = "center")
```
## Standard GitHub workflow
- (I recommend to only fork a public repo if you intend to send a pull request to it)
- Fork the other person's repo (this will be known as the `upstream` repo from your fork, your copy of a repo on GitHub is known as `origin`)
- This creates a copy of their repo under your account (your fork)
- Clone your fork (the copy under your account) to your machine
- Create a new branch (do not work on `master`/`main`)
- Make your changes and commit them
- Push your new branch upto your GitHub (i.e., to your fork)
- Create a pull request (from your new branch) back to the default (`master`/`main`) branch of the original repo
## Workflow with an OpenSAFELY GitHub repo
- Skip the forking step from the standard GitHub workflow
- The repo on GitHub is known as `origin`
- Clone the repo to your local machine
- Click: `Code` | `Open with GitHub Desktop`
```{r}
knitr::include_graphics("img/tp-test-org_test-code-button-owgd.png")
```
- Click `Clone` in the box which appears in GitHub Desktop
```{r, out.width = "100%"}
knitr::include_graphics("img/gd-clone-box.png")
```
- Go to the Making a pull request page [here](05-making-pull-request.html)