Synchronizing one file between two Git repos
I ran into a trivial situation, but it looks like it doesn't have a simple solution: I want to sync one config file between two repositories git
. It can be a one-way interaction: the origin is stored in the project A
and tracked within the projectB
I know the concept git submodule
, but submodulating a large repository into a smaller one for just one file seems overkill.
source to share
You can just add one repo as remote and checkout.
Then you can checkout the file from another branch (including remote tracking )
git remote add repoA A
git fetch repoA
git checkout repoA/master -- file
(Suppose you want a file from A
to repo B
)
source to share