Commit d7afdab7a5fcb1aa686955f6d13e024737e89a94
1 parent
33a00cee
Exists in
spb-stable
and in
3 other branches
Add docs for create branch via api
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
1 changed file
with
31 additions
and
0 deletions
Show diff stats
doc/api/branches.md
| @@ -165,3 +165,34 @@ Parameters: | @@ -165,3 +165,34 @@ Parameters: | ||
| 165 | "protected": false | 165 | "protected": false |
| 166 | } | 166 | } |
| 167 | ``` | 167 | ``` |
| 168 | + | ||
| 169 | +## Create repository branch | ||
| 170 | + | ||
| 171 | + | ||
| 172 | +``` | ||
| 173 | +POST /projects/:id/repository/branches | ||
| 174 | +``` | ||
| 175 | + | ||
| 176 | +Parameters: | ||
| 177 | + | ||
| 178 | ++ `id` (required) - The ID of a project | ||
| 179 | ++ `branch_name` (required) - The name of the branch | ||
| 180 | ++ `ref` (required) - Create branch from commit sha or existing branch | ||
| 181 | + | ||
| 182 | +```json | ||
| 183 | +{ | ||
| 184 | + "name": "my-new-branch", | ||
| 185 | + "commit": { | ||
| 186 | + "id": "8848c0e90327a0b70f1865b843fb2fbfb9345e57", | ||
| 187 | + "message": "Merge pull request #54 from brightbox/use_fog_brightbox_module\n\nUpdate to use fog-brightbox module", | ||
| 188 | + "parent_ids": ["fff449e0bf453576f16c91d6544f00a2664009d8", "f93a93626fec20fd659f4ed3ab2e64019b6169ae"], | ||
| 189 | + "authored_date": "2014-02-20T19:54:55+02:00", | ||
| 190 | + "author_name": "john smith", | ||
| 191 | + "author_email": "john@example.com", | ||
| 192 | + "committed_date": "2014-02-20T19:54:55+02:00", | ||
| 193 | + "committer_name": "john smith", | ||
| 194 | + "committer_email": "john@example.com" | ||
| 195 | + }, | ||
| 196 | + "protected": false | ||
| 197 | +} | ||
| 198 | +``` |