2

I have my software in remote server repository and use the respository to create new instances for new customers which are managed by git. If I make changes in a customer instance, I push the changes back to the server.

The problem I have is that the server repository contains a few files that are needed initially by each customer. These are then personalised in the customer instance. I want these files when I clone the instance initially, but when I push back to the server I want these files to be ignored.

Using .gitignore with these filenames means the files are not created in the initial clone (I want them to be created), but they are ignored when I push back to the server (which is what I want).

So my question is: Can I include these files in the clone, but exclude them when pushing?

user1199529
  • 119
  • 1
  • 8
  • possible duplicate of [Git default files (ignoring after first pull)](http://stackoverflow.com/questions/8584890/git-default-files-ignoring-after-first-pull) – Senseful Aug 14 '14 at 00:20
  • Duplicate of http://stackoverflow.com/questions/1396617/committing-machine-specific-configuration-files – Senseful Aug 15 '14 at 01:02

1 Answers1

1

You can use:

git update-index --assume-unchanged <file>

on each remote server repository, for each file that you don't want committed. (If you have lots of these, a script would probably be helpful).

git add -a will not add these files, git status will not show them but if you do a git add ., the files will be added.

Richard
  • 110
  • 7