-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Getting Started with GitHub
Go with the default options, in every step below, unless otherwise stated. Note: although R and Git are required for proper operation of RStudio, we won't be using them individually.
-
Download and install R, if you haven't. For Windows, select "install R for the first time" when presented with additional options.
https://cloud.r-project.org/ -
Download and install RStudio, if you haven't.
https://www.rstudio.com/products/rstudio/download/ -
Download and install Git.
https://git-scm.com/downloads -
Create an account on GitHub. You can skip this step if you already have such an account.
https://github.com/join
This is a two-step process. You have to "fork" (clone) the course on GitHub, and then create a local copy of your forked project.
Go to the project home at https://github.com/InseadDataAnalytics/INSEADAnalytics and click "Fork" at the top right corner. Note the url of your forked project at this point, it should be in the form of https://github.com/<username>/INSEADAnalytics
.
-
Select "New Project" from the dropdown project menu.
-
Click "Version Control" as the project source.
-
Click "Git" for the version control option.
-
Enter the url of your forked project, as noted earlier, and click "Create Project". Note The path
~/R
represents a folder under "My Documents" on Windows and your home folder on OSX.
Committing and pushing your work on Github is optional for the course. Do get into the habit though - it's cool and ensures replicability and shareability.
We'll be working in Rstudio from now on.
-
Select "R Script" from the dropdown "new file" menu.
-
Enter some sample code, for example
print("hello world")
and save the script (click the disk icon) as "MyTest.R".
-
Select to stage the file in the "Git" panel (click the check box next to "MyTest.R"), and click "Commit".
-
You have the opportunity to review your changes at this point, and enter a descriptive commit message. Do so, and click the "Commit" button.
-
Your local copy of the project is ahead of your remote one by 1 commit. Click "Push" (the green up arrow), either in the "Review Changes" popup or in the "Git" panel, to push your changes to the remote repository. Enter your Github username and password when prompted.