Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best practices for .gitignore #13

Open
khailper opened this issue Jan 15, 2019 · 2 comments
Open

Best practices for .gitignore #13

khailper opened this issue Jan 15, 2019 · 2 comments

Comments

@khailper
Copy link

What sorts of things should be in .gitignore beyond the defaults? If it's something like a whole directory (say, Data), can that be done with something like regex or do the files need to be added individually?

@gaborcsardi
Copy link
Collaborator

gaborcsardi commented Jan 15, 2019

  1. Things that appear frequently in the project folder while you are working on the project, but you don't want to put them in the repository.

  2. They are shell globs. I.e. the same format the bash shell supports. Not regular expressions. It is quite flexible. See this: https://stackoverflow.com/a/8527650/604364 and this: https://en.wikipedia.org/wiki/Glob_%28programming%29#Syntax

@jimhester
Copy link
Collaborator

A useful resource I like is https://www.gitignore.io/

You can search for an OS, e.g. https://www.gitignore.io/api/macos or https://www.gitignore.io/api/windows

Or for a programming language, e.g. https://www.gitignore.io/api/r or https://www.gitignore.io/api/python

Also I think it is pretty useful to put most of these in a global gitignore (https://help.github.com/articles/ignoring-files/#create-a-global-gitignore for setup instructions has setup instructions)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants