Mirrored repository from one service to another
See original GitHub issueSo. I have a case where I develop and build my source on a Gitlab instance, but I sync the repository to a Github.com account. I’d like my Sourcelink to point to the Github.com repository.
So far, I’ve gone over the docs a few times, adding and removing the Microsoft.SourceLink.GitHub
and Microsoft.SourceLink.GitLab
packages. In all cases, I don’t seem to get the Targets files included in my project, due to errors like:
..\ReflectedCast.csproj(30,27): error MSB4066: The attribute "Include" in element <SourceLinkGitHubHost> is unrecognized.
..\ReflectedCast.csproj(28,25): error MSB4066: The attribute "Include" in element <SourceLinkGitLabHosts> is unrecognized.
...\ReflectedCast.csproj(30,14): error MSB4066: The attribute "Update" in element <SourceRoot> is unrecognized.
...\ReflectedCast.csproj(31,14): error MSB4066: The attribute "Remove" in element <SourceRoot> is unrecognized.
I’ve messed with f.ex. the unpacked Targets files in my “.nuget” cache folder, and verified that do indeed get read (a syntax error in those files, is also a build error). What I don’t get, is how those files can use f.ex. <SourceRoot ..>
, but I can’t.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Partially mirroring a repository to another repository
The short answer is: no, you can't do that. A Git repository is, at its heart, two databases. One database holds commits and...
Read more >Repository mirroring | GitLab
Repository mirroring. You can mirror a repository to and from external sources. You can select which repository serves as the source.
Read more >How to Mirror (Copy) an Entire Existing Git Repository Into ...
In this article, we're going to go over the operation of mirroring (in other words, completely and exactly copying) a Git (whether that...
Read more >Duplicating a repository
If you want to mirror a repository in another location, including getting updates from the original, you can clone a mirror and periodically...
Read more >Mirroring a Repository
Open the navigation menu and click Developer Services. · Select a project and click Code Repositories on the left-side menu. · Click Mirror ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I see. A similar scenario is set up in the integration tests, where we mirror from GitHub to VSTS.
This approach should work for your as well - you’ll need to add package references to both GitHub and Gitlab SourceLink packages and add a target to your projects similar to this one:
https://github.com/dotnet/sourcelink/blob/master/src/SourceLink.Git.IntegrationTests/VstsAndGitHubTests.cs#L28-L45
This is gonna work better: https://github.com/dotnet/sourcelink/pull/142