forked from evolgeniusteam/R-for-bioinformatics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtalk00_github.Rmd
188 lines (105 loc) · 5.52 KB
/
talk00_github.Rmd
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
![choose a version for your OS and download the desktop Github app](images/github/github_desktop_download.PNG){height=60%}
## the welcome screen
start the app, and choose sign up (or sign in if you have an account)
![the welcome screen](images/github/github_desktop_welcome.PNG){height=60%}
## sign up
click the sign up link, you will be redirected to the Github website in a browser
![sign up at the github website](images/github/github_create_account.PNG){height=60%}
## sign in
create a new account, go back to the desktop app to sign in
![login using the desktop app](images/github/github_desktop_signin.PNG){height=60%}
# clone a existing repository and update
## clone a repository, step 1
From your Github desktop app
![choose "clone a repository from the internet ... "](images/github/github_desktop_clone_a_repository.PNG){height=60%}
## clone a repository, step 2
repository: ```evolgeniusteam/R-for-bioinformatics ```
![select "URL", and add repository URL or username/repository_name](images/github/github_desktop_clone_a_repository2.PNG){height=60%}
## clone a repository, step 3
![cloning to local folder](images/github/github_desktop_clone_a_repository3.PNG){height=60%}
## clone a repository, step 4
![完成clone](images/github/github_main_page.PNG){height=60%}
## check the local folder
go the local github folder, and check the files downloaded from Github
![files downloaded to local folder](images/github/github_local_folder.PNG){height=60%}
## pull updates, step 1
**pull**: 是从repository下载project或更新的过程
点击 "Fetch origin"按钮,如果有更新,它会变为:“Pull origin”:
![files downloaded to local folder](images/github/github_pull_updated_version.PNG){height=60%}
## pull updates, step 2
完成更新后,可通过"History" tab 查看更新内容
![files downloaded to local folder](images/github/github_pull_updated_version2.PNG){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 ... "
![create new depository using the Desktop app](images/github/new_repo/create_new_repo_01.png){height=30%}
## create a new repo, step 2
![fill in necessary information and create](images/github/new_repo/create_new_repo_02.png){height=60%}
## create a new repo, step 3
![main page of Github desktop app after the new repo was created](images/github/new_repo/create_new_repo_03.png){height=40%}
## open the repo using Atom
Atom can be downloaded from: https://atom.io
![open the repo using Atom](images/github/new_repo/create_new_repo_04.png)){height=50%}
## view and edit repo using Atom
![open the new repo and edit using Atom](images/github/new_repo/create_new_repo_05.png){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.
![markdown file and preview](images/github/new_repo/create_new_repo_06.png){height=50%}
## go back to Github desktop app
changes will be highlighted in the Github desktop app
![](images/github/new_repo/create_new_repo_07.png){height=50%}
## publish the newly created repository
!["publish" a private repository](images/github/new_repo/create_new_repo_08.png){height=50%}
## check the new repository at Githup website
the url will be : <your_username>/<your_repo_name>
![NOTE: newly added contents will NOT be uploaded to Github at this stage](images/github/new_repo/create_new_repo_09.png){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
![***commit*** to master](images/github/new_repo/create_new_repo_10.png){height=60%}
## upload newly added contents and/or changes to Github website, cont.
then use the "Push origin" button to actually upload the changes
![***Push origin***](images/github/new_repo/create_new_repo_11.png){height=60%}
## Atom also 'knows'
Atom then 'knows' that the changes have been synchronized to Github:
![Atom knows](images/github/new_repo/create_new_repo_12.png){height=60%}
# 使用R markdown
## to be continued ...