【发布时间】:2018-03-23 05:09:05
【问题描述】:
我正在尝试通过TFS GIT REST API 将子模块添加到我在 TFS 上的 git 存储库中,但到目前为止还没有运气。我创建了新的存储库并将 .gitmodules 添加到存储库,但不知道如何添加子模块文件夹/引用。
这是我尝试使用 .gitignore、.gitmodules 和名为“SomeTools”的子模块为初始提交构建的原始请求。
POST http://tfs:8080/tfs/My_Collection/My_Projekt/_apis/git/repositories/TestRepo/pushes?api-version=2.0 HTTP/1.1
Accept: */*
Content-Type: application/json
Host: tfs:8080
Content-Length: 7213
{
"refUpdates": [
{
"name": "refs/heads/develop",
"oldObjectId": "0000000000000000000000000000000000000000"
}
],
"commits": [
{
"changes": [
{
"newContent": {
"content": *.suo\r\n",
"contentType": "rawtext"
},
"changeType": "add",
"item": {
"path": "/.gitignore"
}
},
{
"newContent": {
"content": "[submodule \"SomeTools\"]\n\tpath = SomeTools\n\turl = http://tfs:8080/tfs/My_Collection/My_Projekt/_git/SomeTools\n",
"contentType": "rawtext"
},
"changeType": "add",
"item": {
"path": "/.gitmodules"
}
},
{
"newContent": {
"content": "198abf113d8baf48aa55ab1897b30fdb7b23c4cc",
"contentType": "rawtext"
},
"changeType": "add",
"item": {
"path": "/SomeTools",
"versionType": "commit"
}
}
],
"comment": "Initial commit."
}
]
}
【问题讨论】:
标签: git tfs git-submodules tfs-sdk