dsjxgu4759 2013-01-30 21:51
浏览 35
已采纳

将所有“error_log”文件添加到.gitignore

I am getting frustrated with all my PHP error_log files causing merge conflicts with my production & dev servers with git. The solution is easy enough--adding all files that are called "error_log" to .gitignore--but I don't know how to do it. This is what I'm trying in my .gitignore:

error_log

Which is only excluding the error_log file in the root directory (instead of all the other dirs I have PHP running).

Would *error_log work?

Thanks!

  • 写回答

2条回答 默认 最新

  • dongmeixi5311 2013-01-31 01:06
    关注

    Your .gitignore is absolutely correct, but .gitignore will only stop files from being added to the repository – already tracked files are not concerned by this. So, first you need to remove all the error_log files from the index by running:

    git rm --cached '*/error_log' error_log
    

    Now when you run git status some of your error_log files should be listed as “deleted”, but none of them should appear as untracked files.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用