question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mirrored repository from one service to another

See original GitHub issue

So. 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:closed
  • Created 5 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tmatcommented, Jul 31, 2018

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

0reactions
tmatcommented, Jul 31, 2018
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found