Building with SourceLink fails when there is no Git remote named "origin"
See original GitHub issueNoticed in https://github.com/dotnet/iot/issues/553.
I also encountered this while porting Core-Setup to Arcade, but didn’t look into it yet to find this cause. (I disabled SourceLink for now in that effort.)
Repro:
git clone https://github.com/dotnet/arcade
cd arcade
git remote rename origin dotnet
.\Build.cmd
C:\Users\dagood\.nuget\packages\microsoft.sourcelink.common\1.0.0-beta2-19351-01\build\Microsoft.SourceLink.Common.targets(50,5): error : Source control information is not available - the generated source link is empty. [D:\temp\remote\arcade\src\Microsoft.DotNet.SignTool\Microsoft.DotNet.SignTool.csproj]
...
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Why does Git tell me "No such remote 'origin'" when I try to ...
The error message you're encountering indicates that there is no remote named 'origin' in your Git repository. This suggests that the ...
Read more >How to fix fatal: origin does not appear to be a git repository
The fatal: 'origin' does not appear to be a git repository error occurs because git init does not link a local repository to...
Read more >Remote Origin Already Exists Error: How To Fix It
1. Remove the Existing Remote · Create a new repository online using GitHub or GitLab. · Go to your local repository and remove...
Read more >Producing Packages with Source Link - .NET Blog
Learn how to add Source Link to your packages, to make your users more productive while debugging.
Read more >How to fix 'fatal: remote origin already exists' Git error
The most important thing to note here is that origin is only a handler's short name.
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
Odd, that should work. Will take a look.
Definitely agree that the error message could be better. https://github.com/dotnet/sourcelink/issues/324 BTW, currently we first check for
origin
then for any other remote (the first one). dotnet/sourcelink#306 suggests to check the remote tracking branch before falling back toorigin
or other remote.