r/programming • • Nov 20 '10

GitHub has created gitignore which aims to showcase best practices for excluding files from git

https://github.com/github/gitignore
149 Upvotes

23 comments sorted by

16

u/darkclark Nov 20 '10

Good link, though I'm not sure I'd categorize it as 'best practices showcase' so much as a collection useful defaults for various contexts.

0

u/[deleted] Nov 20 '10

[deleted]

2

u/elefantstn Nov 20 '10

Git is both including and excluding. By throwing something in .gitignore, you don't get prompted to add it when you ask if you have any changes. You still have to explicitly add files to control.

1

u/sheafification Nov 20 '10

The classic example is object files that have been compiled from the source. Every time you test your program you get a new object file. Since the source code already determines what the object files are, and the object files are binary (hence not very diff'able), you end up recording huge amounts of information in your repository that is determined by the source code you already included.

7

u/foldl Nov 20 '10

Jurily means "why are we using a blacklist rather than a whitelist?", not "why are we excluding some files from the repo?"

0

u/[deleted] Nov 21 '10

I'd rather have to exclude my *.pyc than find my important_file.rjb wasn't versioned.

2

u/claco Nov 20 '10

Someone make a vim plugin to pull these in context!

3

u/schoscho Nov 20 '10

i miss the drupal one.

9

u/rebo Nov 20 '10

Stop being lazy then , write one and do a pull request.

5

u/schoscho Nov 20 '10

as i am new to git - i'll give it a shot :)

4

u/frogking Nov 20 '10

it will be a learning experience and you will feel good about adding to a popular repository ;-)

2

u/gtani7 Nov 20 '10

3

u/wynyx Nov 20 '10

Wow, that is exactly the same thing as this submission. Too bad gitignore.com breaks the snippets into multiple pages (pretty annoying).

2

u/masklinn Nov 20 '10

Too bad gitignore.com breaks the snippets into multiple pages (pretty annoying).

It's far less complete than TFA as well. Which is kinda sad, since it has a searchbox.

1

u/Beefington Nov 20 '10

What's the best way to merge two or more of these gitignores into a single file? Can you specify multiple core.excludesfiles? Is there some import syntax for gitignore? (if so, whoa)

1

u/Gtoast Nov 20 '10

Seriously. I guess they expect you to keep your local gitignore repository up to date and then concat the ones you want together into your own personal .gitignore file.

I'm also having trouble groking which .gitignores you wouldn't want implemented globally.

1

u/frogking Nov 20 '10

This must be the repository, that have grown fastest in popularity, ever!

The Impact Graph is impressive! So many contributions!

1

u/[deleted] Nov 24 '10

Beautiful Effort! Its immensely helpful :)

0

u/[deleted] Nov 20 '10

[deleted]

6

u/masklinn Nov 20 '10

Although the title makes it sound (to me) as if GitHub invented gitignore…

Well they have created the gitignore project which is a library of .gitignore snippets.

0

u/[deleted] Nov 20 '10

[deleted]

3

u/tinou Nov 21 '10

lawyer up, hit the gym, do a pull request.

0

u/[deleted] Nov 20 '10

[deleted]

1

u/[deleted] Nov 20 '10

You have programming in your personal list of subreddits. It's going to show you a random assortment of all your subreddits no matter if they have only 2 upvotes.

-10

u/omgwolf Nov 20 '10

notice how OP has 2,443 link karma

10

u/masklinn Nov 20 '10

link karma has no influence on how fast your links reach the front page. The only thing that does are votes: 65 people found the link interesting enough to upvote it and want others to see it, 25 thought it sucked and downvoted it. That's it.

0

u/[deleted] Nov 20 '10

[deleted]

1

u/[deleted] Nov 20 '10

we aren't supposed to use the word subreddit anymore

When did this happen?