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 forrepo2
. Parts ofrepo1
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 fromrepo1
. 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 somerepo1
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 relevantrepo1
projects and push them torepo2
.
I guess I'm looking for a less cumbersome version of this approach (ideally not having to do anything locally):
- checkout
repo1
locally - checkout
repo2
locally - copy relevant projects/folders from
repo1
working directory torepo2
working directory - commit changes in
repo2
- push local
repo2
commits to its origin
Any ideas/suggestions?