小编m00*_*0.0的帖子

合并没有公共提交到主分支?

我有一个Git仓库,有很多提交和单独的代码,比方说

/Proj1
Run Code Online (Sandbox Code Playgroud)

我还有另一个Git仓库,其中有1个提交,这不是常见的提交,

/Proj2
Run Code Online (Sandbox Code Playgroud)

如何合并两个repos并使用父提交正确显示历史记录?基本上,两个repos之间没有任何共享提交,但我希望有一个具有两组代码的repo.我希望它看起来像:

proj2 commit
proj2 commit
proj1 commit (root)
Run Code Online (Sandbox Code Playgroud)

我知道rebase是一个选项,但不确定是否使用--onto替换根提交(如果我从远程仓库进行提取,它似乎会这样做rebase --onto --root master).

我尝试过使用最初看起来像是工作的git子树,但是当我使用git-tfs推送我的提交时,我收到的错误是

警告:父...不属于TFS跟踪分支(未在TFS中检查),将被忽略

并且提交实际上并没有推高(也可能是因为它是一个子树).

编辑:我只希望以1个repo(Proj1)结束,但是在Proj1在master分支上提交之后会有Proj2的提交.

git tfs git-tfs

11
推荐指数
1
解决办法
8454
查看次数

VS402881:未指定与工件源“MyBuild”相对应的工件版本。发布管理 vNext REST API

我正在使用 TFS 2015.2 RTM,我刚刚发现 Release Management vNext REST API 在本地 2.2-preview.1 中。我想创建一个版本,但我不知道放入 POST 请求正文的确切 JSON,因为该文档仅适用于 VSTS。

当我发送请求时,我收到错误消息:

VS402881: No artifact version is specified corresponding to artifact source 'MyBuild.' Specify a valid value and try again. 
Run Code Online (Sandbox Code Playgroud)

这是JSON:

$body = @"
     {
          definitionId": 1,
    "description": "test",
    "artifacts": [ 
      {
         "alias": "Tailspin Toys", 
         "version": {
               "id": 147,
         },
         "instanceReference": {
            "id": 5
        }
       }
     ]
} 
"@
Run Code Online (Sandbox Code Playgroud)

这是 Invoke-RestMethod 命令:

$releaseResponse = Invoke-RestMethod -Method Post -Credential $credential -ContentType application/json -Uri $postUri …
Run Code Online (Sandbox Code Playgroud)

rest tfs json ms-release-management

7
推荐指数
1
解决办法
2704
查看次数

TFS REST API-获取字段的允许值

我需要使用TFS 2015 REST API针对特定工作项类型的字段(不在全局列表中)获取允许值的列表。我知道我可以使用“ 获取工作项”字段来获取有关字段的信息,但这似乎并未在响应中提供允许的值。

{
  "name": "Iteration Path",
  "referenceName": "System.IterationPath",
  "type": "treePath",
  "readOnly": true,
  "supportedOperations": [
    {
      "referenceName": "SupportedOperations.Under",
      "name": "Under"
    },
    {
      "referenceName": "SupportedOperations.NotUnder",
      "name": "Not Under"
    },
    {
      "referenceName": "SupportedOperations.Equals",
      "name": "="
    },
    {
      "referenceName": "SupportedOperations.NotEquals",
      "name": "<>"
    },
    {
      "referenceName": "SupportedOperations.In",
      "name": "In"
    }
  ],
  "url": "https://fabrikam-fiber-inc.visualstudio.com/DefaultCollection/_apis/wit/fields/System.IterationPath"
}
Run Code Online (Sandbox Code Playgroud)

看起来好像在六月在MSDN论坛上发布的某个人,但是我想再次检查这是否仍然不可用。

c# rest tfs azure-devops

5
推荐指数
1
解决办法
940
查看次数

根据 SqlClient 的验证过程,远程证书无效

我正在使用 MyHealthClinic 应用程序 ( https://azuredevopslabs.com/labs/vstsextend/kubernetes/ ),它是一个 .NET Core 前端和后端 Kubernetes 集群,并部署到 Google Kubernetes Engine 并尝试连接到 SQL Server VM,但是当 pod 在拉取我推送的映像后尝试启动时,收到以下 CrashLoopBackOff 错误:

Unhandled Exception: System.Data.SqlClient.SqlException: A connection was successfully 
established with the server, but then an error occurred during the pre-login handshake. 
(provider: TCP Provider, error: 35 - An internal exception was caught) ---> 
System.Security.Authentication.AuthenticationException: The remote certificate is invalid 
according to the validation procedure. at 
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken ...
Run Code Online (Sandbox Code Playgroud)

我检查了我的 appsettings.json ,它似乎是正确的,因为我将其设置为:

"DefaultConnection": "Server={my-external-IP},1433;Initial Catalog=mhcdb;Persist Security Info=False;User ID={sqlusername};Password={sqlpassword};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;" …
Run Code Online (Sandbox Code Playgroud)

kubernetes google-kubernetes-engine .net-core

5
推荐指数
1
解决办法
7015
查看次数

在脚本中动态设置 Azure DevOps 变量

我有n个变量需要在发布管道中分配为 Azure DevOps 变量,但似乎我的语法不正确。

这些变量可能具有不同的值(变量名称),例如: - {guid 1} - {guid 2} ...

所以我在运行之前不会知道它们。问题是,vso[task.setvariable] 的所有示例似乎都使用静态变量名称,但我需要动态设置它。

这是应该有效但无效的:

 Write-Host "##vso[task.setvariable variable=$($myVariable)]$($myValue)"
Run Code Online (Sandbox Code Playgroud)

我也尝试过仅使用 [Environment]::SetEnvironmentVariable (与用户一起),并且它似乎不会在同一作业中的两个不同任务中持续存在。

[Environment]::SetEnvironmentVariable($myVariable, $myValue, 'User')
Run Code Online (Sandbox Code Playgroud)

(后续任务中为空)

有什么方法可以动态创建在任务之间持续存在的发布变量吗?我尝试在开发者社区中搜索并发现一个问题,但没有答案。

powershell azure-devops

5
推荐指数
1
解决办法
5564
查看次数

使用PowerShell在TFS 2015 REST API中构建队列

我正在尝试使用带有本地TFS 2015.2的REST API使用PowerShell对构建进行排队.

$body @{ id = 1 }

Invoke-RestMethod -Method Post -Credential "myusername" -ContentType application/json -Uri "https://{tfsurl}/DefaultCollection/Fabrikam-Fiber-Git/_apis/build/builds?api-version=2.0" -Body (ConvertTo-Json $body)
Run Code Online (Sandbox Code Playgroud)

它抛出一个错误,它需要需要在JSON中的定义.PowerShell不喜欢这个,所以我错过了一个简单的语法错误?

$body = @{
"definition": {
    "id":1
 }
}
Run Code Online (Sandbox Code Playgroud)

我看到这篇文章:如何使用REST API触发TFS 2015中的构建,但我认为它对PowerShell方面没有多大帮助.

rest powershell tfs

4
推荐指数
1
解决办法
1918
查看次数