1

Is there any way to ignore a file for push/pull but copy it on clone? In this case I want a config file. When I clone the repo I'd like to pull in the default config but for all other operations ignore the changes. So when cloning the reop the default config file is included, but then any changes to it afterwards are ignored.

The problem with just not committing the file is that it causes issues when trying to do a pull from master as the file has changed.

I can add the file .gitignore but this means I have to manually create it after cloning the repo.

Tom B
  • 2,735
  • 2
  • 24
  • 30
  • You might be interested in http://stackoverflow.com/questions/6782017/whats-the-easiest-way-to-deal-with-project-configuration-files. – Ondrej Slinták Feb 08 '15 at 12:31

1 Answers1

4

No. Ignored file is not in git repository, so it cannot be cloned. Just create config.example file and copy it to config after cloning.

Alexey Ten
  • 13,794
  • 6
  • 44
  • 54