How can you gitignore items in a Drupal project without modifying core? I have a Drupal project, and we want to use Git for version control, but we need to have some folders that are ignored by Git. The problem is that .gitignore seems to be a core file. After the last "drush up" command, the gitignore file was replaced.

So, other than asking each developer to manually add entries to his or her global .gitignore file, is there a good way to effectively .gitignore a path in Drupal?
While .gitignore, .htaccess and robots.txt will come as part of the package when you clone Drupal, they should not be considered part of core and you should not feel that they cannot be changed or replaced with your own files.

This is what I do: Prior to updating (drush up), I make a backup of those three files.  After updating, I use the CLI program diff to compare the newly updated version with my backup (typically, my .gitignore have more entries at the end than those that come with Drupal).  If nothing else has changed, I just overwrite the one that came with Drupal with the backup.  If diff shows that the "drupal part" of .gitignore has changed, I copy those changes into my backup version before overwriting.  (Same procedure with .htaccess and robots.txt.)