是否可以使用Visual Studio Team Services REST API来初始化新创建的存储库?
答案 0 :(得分:0)
不能相信我从VSTS REST api文档中错过了这一点,但是这里是您可以在vsts上创建和初始化新的git存储库,以及在TFS 2015上对其进行测试的方法
创建新的存储库:
帖子:http://tfs:8080/tfs/DefaultCollection/_apis/git/repositories?api-version=3.0
身体:
{
"name": "AnotherRepository",
"project": {
"id": "e7154789-27db-4ee5-a192-4d69594c6588"
}
}
初始化新存储库:
身体:
{
"refUpdates": [
{
"name": "refs/heads/master",
"oldObjectId": "0000000000000000000000000000000000000000"
}
],
"commits": [
{
"comment": "Initial commit.",
"changes": [
{
"changeType": "add",
"item": {
"path": "/readme.md"
},
"newContent": {
"content": "My first file!",
"contentType": "rawtext"
}
}
]
}
]
}
VSTS REST文档: