简体   繁体   中英

gitignore: ignore file not working cakephp

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM