Everyone is using git + github, right?
So the question is, what should you use git for, and what should be on github? My answer: everything and everything.
I use a template for basically every new project, and set that up using projectr. By default, this has folders for analysis
, data
, drafts
, results
, and sources
. There’s also a readme and a .gitignore, which tries to be sure that data don’t end up on github’s servers. Often, I don’t even store the data in the same repo, but instead use a symbolic link to the repo. (I think there’s a good reason for this, involving git’s behavior for symbolic links, but I don’t remember anymore.)
You don’t have to use GH for this, and maybe you won’t – even still, I like to have the sae structure across projects, and end up pushing to GH most of the time. Many of my projects are private repos, at least initially.
Don’t forget – for at least some projects, you can / should fancy up public repos (depending on what you want to do with your life).
Some advice on managing your online presence if you're applying for a job or scholarship, based on my experiences reviewing rstudio::conf scholarship applications (results out soon):
— Hadley Wickham (@hadleywickham) October 31, 2019
For a long time I had an external git client, but almost all my work is in R and managed via an RProject, so I’ve almost completely shifted to RStudio’s git “client”. Also, since I create repos all the friggin time now, an external client is largely not manageable.
A couple of points:
projectr
, the last step I use is to open the readme and copy the usethis::use_github()
command. This creates a repo on GH and takes care of the linking.projectr
, I often use a “GitHub first” approach to creating the repo: create on GH, then create a new RProject from version control.Some steps for the second approach are here.
The RStudio client is a bit stripped down, but for personal use or small collaborations it’s basically fine. For larger projects / big team efforts, I might stick with an external client.
It can help to:
git2r
and gh
packagesThis stuff is mostly helpful for the kind of work that a stripped-down client can’t do.