forked from LOEK-RS-Class/git4loek
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit_basics.qmd
More file actions
108 lines (55 loc) · 2.09 KB
/
Copy pathgit_basics.qmd
File metadata and controls
108 lines (55 loc) · 2.09 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
## The concept of git
{width=700px}
* Command Line Tool
* GUI Versions available, e.g. [GitHub Desktop](https://desktop.github.com/)
* Application with a learning curve
* Core unit: **A repository**
There is an excellent StackOverflow Thread on the [difference between the workspace and the repository](https://stackoverflow.com/questions/59441589/how-is-repository-different-from-workspace).
### git command line
```{{shell}}
git init # to start
git status # to get infos
git add # to add files to the tracking system
git commit # to define changed files as the new standard
```
## GitHub
```{r}
#| fig-column: margin
#| fig-width: 100
#| echo: false
knitr::include_graphics("https://logosmarken.com/wp-content/uploads/2020/12/GitHub-Logo.png")
```
* Cloud Storage for git repositories
* platform for code sharing, documentation, (data)...
* collaboration and (scientific) communication
Besides the plain storage in a cloud environment, GitHub offers a variatey of documentation and collaboration features:
* Wiki
* Issue - Tracker
* Automation
* GitHub Pages
### GitHub related commands on the command line
{width=700px}
```{{sh}}
git remote # to get infos about remote
git push # to send commits to remote
git pull # to download commits from remote
git clone # to download a repository
```
## Setup
```{r}
#| fig-column: margin
#| fig-width: 100
#| echo: false
knitr::include_graphics("https://git-scm.com/images/logo@2x.png")
```
### Get git
* [https://git-scm.com/download/](https://git-scm.com/download/){target="_blank"}
* preinstalled on most GNU/Linux distributions
```{{sh}}
# minimum prerequisit configuration
git config --global user.name "Your Name"
git config --global user.email "your@email.com"
```
### GitHub
* create a [GitHub Account](https://github.com){target="_blank"}
* ssh?