0

Let's say I have a repository with a folder hierarchy like this one:

repo1
    +- project1
    +- project2
    +- project3
    +- project4
    +- project5
    +- ...

There is another repository repo2 which should contain only a subset of projects/folders from the repo1:

repo2
    +- project1
    +- project2
    +- project4

I am looking for the most efficient/simple/reliable (pick any two) way to occasionally synchronize repo1 and repo2.

Conditions:

  • I specifically do not want to add repo1 as a remote repo for repo2. Parts of repo1 that are not supposed to be synchronized should not be accessible.

  • The repo2 repository is essentially a snapshot repository. It will only be updated to include the recent changes from repo1. There will never be any direct, manual commits made to it.

  • Synchronization does not need to happen on every commit in repo1. In fact, the synchronization should only be triggered either explicitly or on some repo1 event that occurs less frequently (such as tagging).

  • It is not necessary to synchronize all individual commits made in repo1 since last synchronization. When synchronizing, it will be enough to just take the current versions of relevant repo1 projects and push them to repo2.

I guess I'm looking for a less cumbersome version of this approach (ideally not having to do anything locally):

  1. checkout repo1 locally
  2. checkout repo2 locally
  3. copy relevant projects/folders from repo1 working directory to repo2 working directory
  4. commit changes in repo2
  5. push local repo2 commits to its origin

Any ideas/suggestions?

Vladimir
  • 35
  • 2
  • 6

0 Answers0