2019-10-15: Setup GitHub, R, RStudio, Git

Based on Happy Git and GitHub for the useR, by Jenny Bryan, the STAT 545 TAs, and Jim Hester.

Register a free GitHub account

This makes it easy for people to search your name and find your username. People need your username to @mention you on GitHub (e.g. to thank you or discuss issues).

Install or update R and RStudio AND Install Git

How to (a) think (b) about (c) upgrading software.

If it hurts so it more often. If you have this kind of exponential relationship, then if you do it more frequently, you can drastically reduce the pain.

-- Martin Fowler in FrequencyReducesDifficulty

Introduce yourself to Git (TODO)

# My ~/.gitconfig at the start
git config --global --list

#Email associated with GitHub
git config --global user.email "maurolepore@gmail.com"
git config --global user.name "Mauro Lepore"

# Other very useful configurations
git config --global push.default "current"
git config --global core.editor "notepad"
git config --global credential.helper "manager"

# My ~/.gitconfig at the end
git config --global --list

Prove local Git can talk to GitHub (SKIP)

Login to http://github.com/

On GitHub:

On Git Bash:

# Clone new repo and move to it
git clone <URL>
cd <new repo>

# Edit README
## Before
cat README.md
echo "A line from local computer" >> README.md
## After
cat README.md

# Commit and push
git add .
git commit -m "Edit README from local computer"
git push

Cache your username and password or set up SSH keys (DONE)

We should be done. We already added this:

git config —global credential.helper manager 

If we need to remove your git credentials on Windows, they are here:

Control Panel > user accounts > credential manager > Windows credentials > Generic credentials

SSH: Skip.

Prove RStudio can find local Git (TODO)

Login to http://github.com/

On GitHub:

On RStudio:

File > New Project ... > Version Control > Git

Edit README, commit and push.

Do it twice to confirm that the credential manager works as expected.

Contemplate if you’d like to install an optional Git client

I recommend GitKraken: https://www.gitkraken.com/download



2DegreesInvesting/ds-incubator documentation built on Oct. 13, 2021, 10:09 a.m.