比如config.yml我已经commit了。 然后修改了config.yml,但对此文件的修改不希望再commit。
PHP中文网2017-04-21 11:19:46
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.
阿神2017-04-21 11:19:46
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.