比如config.yml我已经commit了。 然后修改了config.yml,但对此文件的修改不希望再commit。
认证高级PHP讲师
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.
config.yml.example
config.yml
.gitignore
When configuration is enabled, cp config.yml.example config.yml 即可,然后对于 config.yml updates will not be committed.
cp config.yml.example config.yml
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.
To ignore all changes
If you just ignore a single file
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.