Git(Hub) for (macro)ecologists: invading the programmers’ niche

Diego P.F. Trindade

4/18/23

Reproducibility and Version Control

I use R + DropBox, why should I care?



Something like this can happen

Veryfinal_Version2

Git(Hub) in a nutshell




Git is a version control software that tracks changes to your files over time.




Github is a website for your git-versioned files.

How does Git work?

How does Git work?

Collaborative git

“Always PULL first!”

Collaborative git

Git is totally integrated with R

(some effort needed)


Windows

Mac

$ git --version

$ git config

Personal Access Token (PAT):

## install if needed:
## install.packages("usethis")

usethis::create_github_token()


Run the following line and paste your PAT

gitcreds::gitcreds_set()

Tell git who you are:

Command line

git config --global user.name 'diegoxx'
git config --global user.email 'diego@example.xx'
git config --global --list

Or:

usethis::use_git_config(user.name = "diegoxx", user.email = "diego@example.xx")

You are now ready to go

Let’s make a quick tour

Sources