vsts-mirror-git-repository icon indicating copy to clipboard operation
vsts-mirror-git-repository copied to clipboard

selective cloning of folders in git repository

Open RajatUC opened this issue 5 years ago • 3 comments

Hi, Is it possible to copy/clone selected folders from a source repo to target repo in Azure Devops pipieline ? I have to copy pipeline, dataset & dataflow folders from dev ADF to Prod ADF such that I get all the pipelines from Dev environment but use linked service of prod environment.
Please let me know if some changes in the code can help do that.
Ref: http://scriptedonachip.com/git-sparse-checkout

Thanks, Raj

RajatUC avatar Feb 03 '20 18:02 RajatUC

Thanks for the question @RajatUC!

The purpose of the mirror task currently provided by this extension is to wrap and simplify the utilization of git's mirror functionality, and git's mirror functionality is for ensuring that all the refs from the source repository are synced over to the destination repository.

As such, the subset/selective scenario of only certain folders is incompatible with a full mirror, and is not something that would make sense to add to the git mirror task.

However, we'd be open to considering including a new task that could be bundled with this extension (along with the current/existing mirror task) that would provide other git capabilities which could support such a use case.

If you (or anyone else) is willing to submit a PR with such a new task we'll definitely be happy to review and work on getting it published, but I don't see any of us on the maintainer team developing this new task (at least not for a very long time)

calebcartwright avatar Feb 03 '20 19:02 calebcartwright

cc @traviskosarek - assume you wouldn't have any objections to adding an additional task to the ext as detailed above?

calebcartwright avatar Feb 03 '20 19:02 calebcartwright

@calebcartwright No objections here to adding additional tasks for mirror-like capabilities.

As you mentioned above, I'm not sure if selective mirroring is something git is capable of out of the box, so it would definitely require a bit of logic to maintain the references to commits/etc that pertain to that specific folder path.

I personally don't have the bandwidth to take this on, but I think it would be useful functionality if selective mirroring is a common use case. I'd be glad to review a PR and help test this out!

traviskosarek avatar Feb 11 '20 22:02 traviskosarek