search

Home  >  Q&A  >  body text

How to ignore specified files in Git pull

The same set of code servers and development environments have different configuration files. Through .gitignore, I can ignore the submission of configuration files during development, but my needs are not like this. I need to add the configuration files to version control, but the server does not There is no need to pull the development-side configuration file.

In other words, I need to ignore the configuration file when I git pull the code on the server. What command should I use?

I used commands like git update-index --assume-unchanged config/config.php and it didn’t work.

巴扎黑巴扎黑2811 days ago684

reply all(1)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-02 09:40:48

    You can modify your config on the server so that the configuration files on the server will not be overwritten when you git pull.
    (ps: It is recommended to use rsync to implement code online deployment.)

    reply
    0
  • Cancelreply