You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## What does cloning a repository from GitHub allow you to do?
634
+
635
+
```{r}
636
+
#| output: asis
637
+
#| echo: false
638
+
cat(longmcq(c(
639
+
"View the repository in your browser, but not edit any files locally.",
640
+
"Copy the repository to a new GitHub account without keeping any history.",
641
+
answer = paste0(
642
+
"Create a local copy of the remote repository on your computer so you can ",
643
+
"edit files and sync changes between local and remote."
644
+
)
645
+
)))
646
+
```
647
+
648
+
:::
649
+
650
+
:::{.callout-note}
651
+
652
+
## You have edited `README.md` and want those changes included in your next commit. Which command should you run first?
653
+
654
+
```{r}
655
+
#| output: asis
656
+
#| echo: false
657
+
cat(longmcq(c(
658
+
"`git status README.md`",
659
+
answer = "`git add README.md`",
660
+
"`git clone README.md`"
661
+
)))
662
+
```
663
+
664
+
:::
623
665
624
-
We will provide examples in both Python and R - following along in your own repository helps build understanding and practial skills.
666
+
:::{.callout-note}
625
667
626
-
### Steps to practice
668
+
## You are working alone on a project and want to try a risky change without breaking your main code. What is the best Git approach?
669
+
670
+
```{r}
671
+
#| output: asis
672
+
#| echo: false
673
+
cat(longmcq(c(
674
+
"Clone the repository again into a new folder and work only in that copy.",
675
+
answer = paste0(
676
+
"Create a new branch, make changes there, and merge back ",
677
+
"when you're happy."
678
+
),
679
+
"Edit files directly on the main branch and hope you can undo if needed."
680
+
)))
681
+
```
682
+
683
+
:::
684
+
685
+
:::{.callout-note}
686
+
687
+
## What is a key advantage of creating a GitHub organisation for a team project?
688
+
689
+
```{r}
690
+
#| output: asis
691
+
#| echo: false
692
+
cat(longmcq(c(
693
+
answer = paste0(
694
+
"It provides shared ownership and continuity so multiple people can ",
695
+
"manage and access related repositories under one organisational account."
696
+
),
697
+
"It hides all repositories from collaborators so only you can access them."
698
+
)))
699
+
```
700
+
701
+
:::
702
+
703
+
### Activity
704
+
705
+
If you haven't already, **have a go at setting up a GitHub repository** to use when working through this book. We will provide examples in both Python and R, and following along in your own repository will help build understanding and practial skills. You should try to:
627
706
628
707
::: {.python-content}
629
708
1.**Create a repository** (e.g. `des-rap-python`) with `README.md`, `.gitignore` and `LICENSE`.
@@ -642,8 +721,6 @@ We will provide examples in both Python and R - following along in your own repo
642
721
643
722
6.**Delete the branch**.
644
723
645
-
<br>
646
-
647
724
::: {.callout-tip}
648
725
649
726
If you plan to explore both languages, make separate repositories for each, as their project structures and workflows differ.
0 commit comments