Git Ignore files when make a pull

前端 未结 2 592
醉梦人生
醉梦人生 2021-01-14 07:47

I am new at github and I am developing an app that has a config.php file that you must enter the database credentials.

In my github repository the file

相关标签:
2条回答
  • 2021-01-14 08:39

    To stop tracking a file you need to remove it from the index. This can be achieved with this command:

    git rm --cached <file>

    Commit that change

    git commit -am "Remove ignored config.php"

    0 讨论(0)
  • 2021-01-14 08:44

    .gitignore is for ignoring untracked files, but you need to ignore changes in the tracked one. you could use git update-index --skip-worktree /path/to/config.php

    See https://git-scm.com/docs/git-update-index#_skip_worktree_bit

    0 讨论(0)
提交回复
热议问题