|
| 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} |
0 commit comments