2

I have .gitignore file in my project, I want to ignore debug_kit.sqlite too I add this file in my .gitignore but still not working, when I rebase I have a conflit in this file. Auto-merging tmp/debug_kit.sqlite CONFLICT (content): Merge conflict in tmp/debug_kit.sqlite

this is .gitignore file:

# CakePHP 3
/vendor/*
/config/app.php

/tmp/cache/models/*
!/tmp/cache/models/empty
/tmp/cache/persistent/*
!/tmp/cache/persistent/empty
/tmp/cache/views/*
!/tmp/cache/views/empty
/tmp/sessions/*
!/tmp/sessions/empty
/tmp/tests/*
!/tmp/tests/empty
/tmp/debug_kit.sqlite

/logs/*
!/logs/empty

# CakePHP 2

/app/tmp/*
/app/Config/core.php
/app/Config/database.php
/vendors/*
Status API Training Shop Blog About
© 2016 GitHub, Inc. Terms P
Malki Mohamed
  • 1,578
  • 2
  • 23
  • 40

1 Answers1

4

The .gitignore only affects files before they are added to Git. If a file has been added to the index already, then putting it in the gitignore after the fact makes no difference.

Delete the file from git first. Then the gitignore will keep it from being added again:

git rm --cached /tmp/debug_kit.sqlite
Harald Nordgren
  • 11,693
  • 6
  • 41
  • 65
  • It was helpful, but i still hav this Conflit: `CONFLICT (modify/delete): tmp/debug_kit.sqlite deleted in HEAD and modified in add groups and recherche frequente. Version add groups and recherche frequente of tmp/debug_kit.sqlite left in tree. "add groups and recherche frequente" is an old commit ` – Malki Mohamed Jan 29 '17 at 18:15
  • thanks, it works now with using this link [http://stackoverflow.com/questions/11451535/gitignore-not-working] too, – Malki Mohamed Feb 05 '17 at 11:57