-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgit.Rmd
More file actions
75 lines (38 loc) · 3.18 KB
/
git.Rmd
File metadata and controls
75 lines (38 loc) · 3.18 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
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
---
title: "Git and GitHub"
---
Our course will make extensive use of Git, GitHub, and GitHub Classroom. In short, our course repositories will hold class notes, data, info, and discussions (the website you are currently viewing is also a part of our repository).
### What are Git and GitHub?
[Git](https://git-scm.com/) is the *de facto* go-to solution for version control and open-source collaboration. Think of "track-changes" on steroids for code files. [GitHub](https://github.com/) is the leading cloud hosting service of Git repositories, that enables efficient and transparent code sharing and collaboration.
### Git installation
Visit [http://git-scm.com/downloads](http://git-scm.com/downloads) and download the graphical Git installer that is most appropriate for your machine’s operating system (Mac, Windows, etc.).
Run the installer and follow the instructions. The default installation options are usually all you need for configuring Git on your local machine.
### Open a GitHub account
Visit [http://github.com](http://github.com) and create an account (if you don't already have one.)
### GitHub Desktop installation
GitHub Desktop provides a straightforward GUI interface to git and GitHub. It enables you to easily sync between your local and remote repositories and apply basic git commands with a click of a button.
Visit [https://desktop.github.com/](https://desktop.github.com/) to download GitHub Desktop, and follow the installation guide.
### Cloning the __course-spring2019__ repository
1. Once Git, GitHub account, and GitHub desktop are all set, visit the [course-spring2019](https://github.com/huji-ml4econ/course-spring2019) repository.
2. Once in the repository, click on the green **Clone or download** button, while making sure that GitHub Desktop is running in the background (this is important!):
```{r, echo=FALSE, out.width = "70%", fig.align='center'}
knitr::include_graphics("figures/clone.gif")
```
3.If done correctly, GitHub Desktop should prompt you with a request for a local destination for the __course-spring2019__ cloned repo. Choose where you want to install your local copy of the repo, click OK, and you're done.
4. To view your local clone of the course-spring2019 folder, press Ctrl + Shift + F while in GitHub Desktop.
```{r, echo=FALSE, out.width = "70%", fig.align='center'}
knitr::include_graphics("gitctlshftF/pull.gif")
```
### Keeping your local repo synced
Follow these steps to keep your copy of the __course-spring2019__ repo synced with the remote repo:
1. Open GitHub Desktop.
2. Set the Current repository to __course-spring2019__.
3. Click on the "Fetch origin" button.
4. If it says Pull with a number next to it (e.g., "Pull" +1), click on it and you're done.
```{r, echo=FALSE, out.width = "70%", fig.align='center'}
knitr::include_graphics("figures/pull.gif")
```
### Further Resources
+ [Happy Git and GitHub for the useR](https://happygitwithr.com/)
+ The second chapter of DataCamp's [Working with the RStudio IDE (Part 2)](https://www.datacamp.com/courses/working-with-the-rstudio-ide-part-2) course.
+ DataCamp's [Introduction to Git for Data Science](https://www.datacamp.com/courses/introduction-to-git-for-data-science) course.