Skip to content

Commit bdd1fde

Browse files
committedOct 9, 2021
first
1 parent eec1a1b commit bdd1fde

17 files changed

+497
-0
lines changed
 

Diff for: ‎.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.Rproj.user
2+
.Rhistory
3+
.RData
4+
.Ruserdata

Diff for: ‎MAT381E_Deliverables_Git_GitHub_RStudio.Rmd

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
title: 'Git and GitHub inside RStudio'
3+
fontsize: 12pt
4+
date: "Fall 2021"
5+
output:
6+
pdf_document:
7+
fig_caption: yes
8+
keep_tex: yes
9+
latex_engine: pdflatex
10+
word_document: default
11+
html_document:
12+
df_print: paged
13+
fontfamily: mathpazo
14+
header-includes: \linespread{1.05}
15+
\usepackage{xcolor} #enable to use xcolor package to color the text
16+
geometry: margin=1in
17+
---
18+
19+
We will be using `git` and `GitHub` to get send your individual-based and team-based studies and get them back. In this short tutorial, we will show you the process using `git` and `GitHub` through `RStudio`. For that reason you have to install `git` (the one most suitable for your operating system), introduce your `GitHub` account to your local `git`, and make sure `RStudio` can talk to local `git` (and, therefore, `GitHub`). If you need assistance, I strongly suggest you to take a look at the following great sources:
20+
21+
22+
https://happygitwithr.com/ and
23+
24+
https://ourcodingclub.github.io/tutorials/git/.
25+
26+
27+
We will create all individual-based and team-based assignments in `GitHub` classroom of `MAT381E-Fall21` organization.
28+
29+
```{r echo=FALSE, results='asis', out.width='100%'}
30+
knitr::include_graphics('images/organization.png')
31+
```
32+
Afterwards, we will send out you the assignment invitation links to you via Ninova announcements so that you can join the assignment (you have to accept the invitation to see the assignment repo under `MAT381E-Fall21` organization). Once you accept the invitation, you will see that **you have a repository under `MAT381E-Fall21` organization for the relevant assignment**. For example `<HW1-yourusername` for Homework 1. Please see my fake student repo for HW 1.
33+
34+
```{r echo=FALSE, results='asis', out.width='100%', fig.cap=''}
35+
knitr::include_graphics('images/github_gulstudent2.png')
36+
```
37+
38+
Throughout the semester you will be an **outside collaborator** of `MAT381E-Fall21` organization on GitHub, not a member. This means that you can only see your repository under `MAT381E-Fall21` organization, whereas I can see all the repositories.
39+
40+
In the "repository URL", copy the SSH URL of the assignment as shown below (in my fake account, i did not take SSH key, but you should do, otherwise you cannot commit and push your work from R Studio to GitHub) :
41+
42+
43+
```{r echo=FALSE, results='asis', out.width='100%'}
44+
knitr::include_graphics('images/green.png')
45+
```
46+
47+
Then, in RStudio, start a new project:
48+
49+
`File > New Project > Version Control > Git `
50+
51+
```{r echo=FALSE, results='asis', out.width='100%'}
52+
knitr::include_graphics('images/git1.png')
53+
```
54+
55+
Paste the URL of the assignment as shown below:
56+
57+
```{r echo=FALSE, results='asis', out.width='100%'}
58+
knitr::include_graphics('images/git2.png')
59+
```
60+
61+
Click "Create Project". You should now see the files in the repository in the lower right window in RStudio. Also notice that Git tab appears at the top right window in RStudio.
62+
63+
```{r echo=FALSE, results='asis', out.width='100%'}
64+
knitr::include_graphics('images/git3.png')
65+
```
66+
67+
Now, you have a local copy of your assignment. Work on it. Do whatever you need. You can use Git tab to `commit` and `push`.
68+
69+
```{r echo=FALSE, results='asis', out.width='100%'}
70+
knitr::include_graphics('images/commit1.png')
71+
knitr::include_graphics('images/commit2.png')
72+
knitr::include_graphics('images/push.png')
73+
```
74+
75+
76+
Check back your repository on GitHub!..Always send your assignments on time!..(In the terminal window, use git commands `commit` and `push` to send the changes you have done to your local repository to GitHub.)
77+
78+
79+
Wish you a productive semester!..
80+
81+
```{r echo=FALSE, results='asis', out.width='100%', fig.cap=''}
82+
knitr::include_graphics('images/github3.png')
83+
```
84+
85+
86+

Diff for: ‎MAT381E_Deliverables_Git_GitHub_RStudio.html

+243
Large diffs are not rendered by default.

Diff for: ‎MAT381E_Deliverables_Git_GitHub_RStudio.pdf

1.29 MB
Binary file not shown.

Diff for: ‎MAT381E_Deliverables_Git_GitHub_RStudio.tex

+151
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
% Options for packages loaded elsewhere
2+
\PassOptionsToPackage{unicode}{hyperref}
3+
\PassOptionsToPackage{hyphens}{url}
4+
%
5+
\documentclass[
6+
12pt,
7+
]{article}
8+
\title{Git and GitHub inside RStudio}
9+
\author{}
10+
\date{\vspace{-2.5em}Fall 2021}
11+
12+
\usepackage{amsmath,amssymb}
13+
\usepackage{lmodern}
14+
\usepackage{iftex}
15+
\ifPDFTeX
16+
\usepackage[T1]{fontenc}
17+
\usepackage[utf8]{inputenc}
18+
\usepackage{textcomp} % provide euro and other symbols
19+
\else % if luatex or xetex
20+
\usepackage{unicode-math}
21+
\defaultfontfeatures{Scale=MatchLowercase}
22+
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
23+
\fi
24+
% Use upquote if available, for straight quotes in verbatim environments
25+
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
26+
\IfFileExists{microtype.sty}{% use microtype if available
27+
\usepackage[]{microtype}
28+
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
29+
}{}
30+
\makeatletter
31+
\@ifundefined{KOMAClassName}{% if non-KOMA class
32+
\IfFileExists{parskip.sty}{%
33+
\usepackage{parskip}
34+
}{% else
35+
\setlength{\parindent}{0pt}
36+
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
37+
}{% if KOMA class
38+
\KOMAoptions{parskip=half}}
39+
\makeatother
40+
\usepackage{xcolor}
41+
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
42+
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
43+
\hypersetup{
44+
pdftitle={Git and GitHub inside RStudio},
45+
hidelinks,
46+
pdfcreator={LaTeX via pandoc}}
47+
\urlstyle{same} % disable monospaced font for URLs
48+
\usepackage[margin=1in]{geometry}
49+
\usepackage{graphicx}
50+
\makeatletter
51+
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
52+
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
53+
\makeatother
54+
% Scale images if necessary, so that they will not overflow the page
55+
% margins by default, and it is still possible to overwrite the defaults
56+
% using explicit options in \includegraphics[width, height, ...]{}
57+
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
58+
% Set default figure placement to htbp
59+
\makeatletter
60+
\def\fps@figure{htbp}
61+
\makeatother
62+
\setlength{\emergencystretch}{3em} % prevent overfull lines
63+
\providecommand{\tightlist}{%
64+
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
65+
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
66+
\linespread{1.05} \usepackage{xcolor}
67+
\ifLuaTeX
68+
\usepackage{selnolig} % disable illegal ligatures
69+
\fi
70+
71+
\begin{document}
72+
\maketitle
73+
74+
We will be using \texttt{git} and \texttt{GitHub} to get send your
75+
individual-based and team-based studies and get them back. In this short
76+
tutorial, we will show you the process using \texttt{git} and
77+
\texttt{GitHub} through \texttt{RStudio}. For that reason you have to
78+
install \texttt{git} (the one most suitable for your operating system),
79+
introduce your \texttt{GitHub} account to your local \texttt{git}, and
80+
make sure \texttt{RStudio} can talk to local \texttt{git} (and,
81+
therefore, \texttt{GitHub}). If you need assistance, I strongly suggest
82+
you to take a look at the following great sources:
83+
84+
\begin{verbatim}
85+
https://happygitwithr.com/ and
86+
87+
https://ourcodingclub.github.io/tutorials/git/.
88+
\end{verbatim}
89+
90+
We will create all individual-based and team-based assignments in
91+
\texttt{GitHub} classroom of \texttt{MAT381E-Fall21} organization.
92+
93+
\includegraphics[width=1\linewidth]{images/organization} Afterwards, we
94+
will send out you the assignment invitation links to you via Ninova
95+
announcements so that you can join the assignment (you have to accept
96+
the invitation to see the assignment repo under \texttt{MAT381E-Fall21}
97+
organization). Once you accept the invitation, you will see that
98+
\textbf{you have a repository under \texttt{MAT381E-Fall21} organization
99+
for the relevant assignment}. For example
100+
\texttt{\textless{}HW1-yourusername} for Homework 1. Please see my fake
101+
student repo for HW 1.
102+
103+
\begin{figure}
104+
\includegraphics[width=1\linewidth]{images/github_gulstudent2} \end{figure}
105+
106+
Throughout the semester you will be an \textbf{outside collaborator} of
107+
\texttt{MAT381E-Fall21} organization on GitHub, not a member. This means
108+
that you can only see your repository under \texttt{MAT381E-Fall21}
109+
organization, whereas I can see all the repositories.
110+
111+
In the ``repository URL'', copy the SSH URL of the assignment as shown
112+
below (in my fake account, i did not take SSH key, but you should do,
113+
otherwise you cannot commit and push your work from R Studio to GitHub)
114+
:
115+
116+
\includegraphics[width=1\linewidth]{images/green}
117+
118+
Then, in RStudio, start a new project:
119+
120+
\texttt{File\ \textgreater{}\ New\ Project\ \textgreater{}\ Version\ Control\ \textgreater{}\ Git}
121+
122+
\includegraphics[width=1\linewidth]{images/git1}
123+
124+
Paste the URL of the assignment as shown below:
125+
126+
\includegraphics[width=1\linewidth]{images/git2}
127+
128+
Click ``Create Project''. You should now see the files in the repository
129+
in the lower right window in RStudio. Also notice that Git tab appears
130+
at the top right window in RStudio.
131+
132+
\includegraphics[width=1\linewidth]{images/git3}
133+
134+
Now, you have a local copy of your assignment. Work on it. Do whatever
135+
you need. You can use Git tab to \texttt{commit} and \texttt{push}.
136+
137+
\includegraphics[width=1\linewidth]{images/commit1}
138+
\includegraphics[width=1\linewidth]{images/commit2}
139+
\includegraphics[width=1\linewidth]{images/push}
140+
141+
Check back your repository on GitHub!..Always send your assignments on
142+
time!..(In the terminal window, use git commands \texttt{commit} and
143+
\texttt{push} to send the changes you have done to your local repository
144+
to GitHub.)
145+
146+
Wish you a productive semester!..
147+
148+
\begin{figure}
149+
\includegraphics[width=1\linewidth]{images/github3} \end{figure}
150+
151+
\end{document}

Diff for: ‎git_github_rstudio_usage_guide.Rproj

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Version: 1.0
2+
3+
RestoreWorkspace: Default
4+
SaveWorkspace: Default
5+
AlwaysSaveHistory: Default
6+
7+
EnableCodeIndexing: Yes
8+
UseSpacesForTab: Yes
9+
NumSpacesForTab: 2
10+
Encoding: UTF-8
11+
12+
RnwWeave: Sweave
13+
LaTeX: pdfLaTeX

Diff for: ‎images/.DS_Store

6 KB
Binary file not shown.

Diff for: ‎images/commit1.png

203 KB
Loading

Diff for: ‎images/commit2.png

75.4 KB
Loading

Diff for: ‎images/git1.png

62.8 KB
Loading

Diff for: ‎images/git2.png

140 KB
Loading

Diff for: ‎images/git3.png

271 KB
Loading

Diff for: ‎images/github3.png

315 KB
Loading

Diff for: ‎images/github_gulstudent2.png

78.9 KB
Loading

Diff for: ‎images/green.png

128 KB
Loading

Diff for: ‎images/organization.png

178 KB
Loading

Diff for: ‎images/push.png

78.8 KB
Loading

0 commit comments

Comments
 (0)
Please sign in to comment.