Git是否可以忽略对已经commit过的文件的变更?
PHP中文网
PHP中文网 2017-04-21 11:17:46
0
2
558

比如config.yml我已经commit了。 然后修改了config.yml,但对此文件的修改不希望再commit。

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
Ty80

To ignore all changes

git reset --hard

If you just ignore a single file

git checkout filename.txt

sry, I misinterpreted it

You can omit the config.yml.example 加入版本库,然后将 config.yml.gitignore.

When configuration is enabled, cp config.yml.example config.yml 即可,然后对于 config.yml updates will not be committed.

阿神

Just put it directly in .gitignore 文件里面屏蔽掉 config.yml. What has been committed before will not change, and Git will automatically ignore the modification to this file in the future.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!