I have 3 git repositories:
- local: my development repo on my local machine;
- remote1used for collaboration with other developers;
- remote2which is a Production server.- I would like to - pullregularly from- remote1to my- localrepo and keep some local tracked files intact (i.e. fetch and merge from- remote1, but exclude some local tracked files from being merged).
- On the other side, I would like to regularly - pushto- remote2and I would like local tracked files to be pushed as well.
 
In other words, I would like to have the following versions of file1:
- local: file1 v.1
- remote1: file1, v.2
- remote2: file1, v.1
Note: file1 can be anything (.css, .html, even .png)
I have tried the following approaches:
- .gitignorea file (does not work, the file becomes being tracked again after pull from- remote1)
- git pull --no-ff --no-commit remote1 master, then- git checkout --ours file1according to this (does not work, file1 becomes v.2)
- .git/info/excludeas described here (does not work, nothing is ignored and even if it is ignored,- file1will not be pushed to- remote2then)
 
     
    