Everyone is using git + github, right?

What is git for?

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).

Using git in RStudio

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:

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.

Using git to go crazy

It can help to:

This stuff is mostly helpful for the kind of work that a stripped-down client can’t do.