$str = "Hello there folks!"
$str_ex = explode("there, $str, 2); //explodes $string just twice
//outputs: array ("Hello ", " folks")
$str_final = implode("", $str_ex); // glues above array together
// outputs: str("Hello folks")
Есть еще одно дополнительное пространство, но в моем случае это не имело значения, поскольку это было для скрипта backgound.
Вы можете использовать остальные api для достижения того, чего хотите. Остальное api из , создающее начальную фиксацию (создание новой ветки) , выглядит следующим образом:
POST https://fabrikam.visualstudio.com/_apis/git/repositories/{repositoryId}/pushes?api-version=4.1
{
"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"
}
}
]
}
]
}
OldObjectId
до0000000000000000000000000000000000000000
. – Tane Yoroshi 16 July 2018 в 08:52