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 fromremote1to mylocalrepo and keep some local tracked files intact (i.e. fetch and merge fromremote1, but exclude some local tracked files from being merged).On the other side, I would like to regularly
pushtoremote2and 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.1remote1: file1, v.2remote2: 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 fromremote1)git pull --no-ff --no-commit remote1 master, thengit 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 toremote2then)