How to make Git ignore changes I'm making to a file (under source control)?

前端 未结 2 450
暖寄归人
暖寄归人 2021-01-28 17:35

I am using git for big web application. At my local end I want to make few files unchanged during work flow of git. For example there is database and config files which have dif

2条回答
  •  死守一世寂寞
    2021-01-28 18:00

    You can't lock file.

    Instead, you can create an example-file (so you have a base config file) and copy it at the right place.

    git mv path/to/config path/to/config-example
    echo "path/to/config" >>.gitignore
    cp path/to/config-example path/to/config
    

提交回复
热议问题