happy-git-with-r icon indicating copy to clipboard operation
happy-git-with-r copied to clipboard

Importance of `.gitignore`

Open lrossouw opened this issue 5 years ago • 3 comments

For new members in my team I drill in the importance of ensuring that you do not commit data (or sensitve stuff like API keys) to the repo.

I think .gitignore and it's use should be highlighted in this regard.

lrossouw avatar Jun 20 '19 19:06 lrossouw

Agree, would be a nice addition

danielkupka avatar Jul 29 '19 13:07 danielkupka

Kind of a duplicate of #116, but this has more words 😀

There's probably scope for a chapter on the config most people need sooner rather than later.

Having a good user-level .gitignore and sound overall gitignoring habits is a good addition. Mention usethis::git_vaccinate() and how RStudio and usethis are also good about giving you a basic .gitignore if you initiate packages with them.

I sort of have a start on such a chapter here (this covers configuring the editor):

https://happygitwithr.com/hello-git.html#more-about-git-config

Also: line ending stuff for Windows people.

jennybc avatar Aug 02 '19 17:08 jennybc

I can also suggest: A good default .gitignore here.

Thouhg I'd add:

# All RData files
*.RData

Also, assuming windows, and office files intermingled I may add:

# Office
*.doc
*.doc?
*.xls
*.xls?
*.ppt
*.ppt?

# Zip
*.zip

Also a data sublfolder:

# Data folder
data\

# And/or CSV
*.csv

lrossouw avatar Aug 03 '19 10:08 lrossouw