forked from Lucas04-nhr/R-for-Data-Science
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtalk00_github.Rmd
More file actions
188 lines (105 loc) · 5.52 KB
/
talk00_github.Rmd
File metadata and controls
188 lines (105 loc) · 5.52 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
---
title: "Tutorial for Github and R markdown"
subtitle: "HUST Bioinformatics course series"
author: "Wei-Hua Chen (CC BY-NC 4.0)"
institute: "HUST, China"
date: "`r format(Sys.time(), '%d %B, %Y')`"
output:
beamer_presentation:
theme: AnnArbor
colortheme: beaver
fonttheme: structurebold
highlight: tango
includes:
in_header: mystyle.sty
---
```{r include=FALSE}
color_block = function(color) {
function(x, options) sprintf('\\color{%s}\\begin{verbatim}%s\\end{verbatim}',
color, x)
}
## 将错误信息用红色字体显示
knitr::knit_hooks$set(error = color_block('red'))
```
## TOC
1. install Github, sign up and sign in
2. clone existing repository (e.g. this repo) to local computer, and get updates
3. create a new repository, add contents and upload to Github server
4. R markdown
## what is Github?
* GitHub是一个面向开源及私有软件项目的托管平台
* 支持git 作为唯一的版本库格式进行托管
* GitHub于2008年4月10日正式上线
* 2018年6月4日,被微软75亿美元收购
**注**:资料来自百度百科
# 1. install Github, sign up and sign in
## 下载 Github desktop
go to: desktop.github.com
{height=60%}
## the welcome screen
start the app, and choose sign up (or sign in if you have an account)
{height=60%}
## sign up
click the sign up link, you will be redirected to the Github website in a browser
{height=60%}
## sign in
create a new account, go back to the desktop app to sign in
{height=60%}
# clone a existing repository and update
## clone a repository, step 1
From your Github desktop app
{height=60%}
## clone a repository, step 2
repository: ```evolgeniusteam/R-for-bioinformatics ```
{height=60%}
## clone a repository, step 3
{height=60%}
## clone a repository, step 4
{height=60%}
## check the local folder
go the local github folder, and check the files downloaded from Github
{height=60%}
## pull updates, step 1
**pull**: 是从repository下载project或更新的过程
点击 "Fetch origin"按钮,如果有更新,它会变为:“Pull origin”:
{height=60%}
## pull updates, step 2
完成更新后,可通过"History" tab 查看更新内容
{height=60%}
**注**:定期检查更新,以获取最新内容
# 3. create a new repository and push to Github
## create a new repo on your computer
from the Github desktop app, select "File" menu -> "New depository ... "
{height=30%}
## create a new repo, step 2
{height=60%}
## create a new repo, step 3
{height=40%}
## open the repo using Atom
Atom can be downloaded from: https://atom.io
){height=50%}
## view and edit repo using Atom
{height=50%}
Please read more about markdown at here: https://guides.github.com/features/mastering-markdown/
## edit and preview markdown file
enable the "Markdown Preview Enhanced" package to preview the markdown file on the fly. This package should be obtained from: https://atom.io/packages/markdown-preview-enhanced.
{height=50%}
## go back to Github desktop app
changes will be highlighted in the Github desktop app
{height=50%}
## publish the newly created repository
{height=50%}
## check the new repository at Githup website
the url will be : <your_username>/<your_repo_name>
{height=50%}
## upload newly added contents and/or changes to Github website
first, use the Github desktop app to upload (push) new contents and/or changes
{height=60%}
## upload newly added contents and/or changes to Github website, cont.
then use the "Push origin" button to actually upload the changes
{height=60%}
## Atom also 'knows'
Atom then 'knows' that the changes have been synchronized to Github:
{height=60%}
# 使用R markdown
## to be continued ...