问题
Is it possible to get a raw link to a file or path that is hosted in our Azure DevOps repository; like we can share on GitHub?
回答1:
Not at present time. VSTS is intended to be a private code repository for teams, not public.
You can always push your repos to GitHub as well as VSTS if you want to provide public code.
回答2:
Yes, this is possible if your project is defined as public; the API that allows one to do this is documented here.
An example from one of my public repos: https://dev.azure.com/ByteTerrace/CSharp/_apis/git/repositories/ByteTerrace.Maths.BitwiseHelpers/Items?path=%2FProject%2FBitwiseHelpers.cs&recursionLevel=0&versionDescriptor.version=master&versionDescriptor.versionOptions=0&versionDescriptor.versionType=0&includeContent=true&resolveLfs=true
Finally, here is the parameterized version; for convenience: https://dev.azure.com/{OrganizationName}/{ProjectName}/_apis/git/repositories/{RepositoryName}/Items?path={PathToFile}&recursionLevel=0&versionDescriptor.version=master&versionDescriptor.versionOptions=0&versionDescriptor.versionType=0&includeContent=true&resolveLfs=true
来源:https://stackoverflow.com/questions/46303201/how-can-one-make-files-in-an-azure-devops-repository-publicly-accessible