我对一个我不想提交到我的存储库的文件进行了本地更改.它是用于在服务器上构建应用程序的配置文件,但我想在本地使用不同的设置进行构建.当然,当我将'git status'作为要上演的东西时,该文件总是显示出来.我想隐藏这个特定的更改而不是提交它.我不会对文件进行任何其他更改.
经过一番挖掘后,我看到了两个选项:'假设未改变'和'跳过工作树'.这里的前一个问题谈到了它们,但并没有真正解释它们之间的区别.我的问题是:这两个命令有何不同?为什么有人会使用其中一个?
我在CodeIgniter站点中有几个文件,我希望在repo中有这些文件但不跟踪任何更改.
例如,我将此框架的新安装部署到新客户端,我希望下载以下文件(它们具有默认值CHANGEME),我只需要对此客户端进行特定更改(数据库凭据,电子邮件地址信息,自定义CSS).
// the production config files i want the files but they need to be updated to specific client needs
application/config/production/config.php
application/config/production/database.php
application/config/production/tank_auth.php
// index page, defines the environment (production|development)
/index.php
// all of the css/js cache (keep the folder but not the contents)
/assets/cache/*
// production user based styling (color, fonts etc) needs to be updated specific to client needs
/assets/frontend/css/user/frontend-user.css
Run Code Online (Sandbox Code Playgroud)
目前如果我跑
git clone git@github.com:user123/myRepo.git httpdocs
Run Code Online (Sandbox Code Playgroud)
然后编辑上面的文件,一切都很棒.直到我发布修补程序或补丁并运行git pull.然后我的所有更改都会被覆盖.