diff options
Diffstat (limited to 'docs/gl_objects/commits.py')
-rw-r--r-- | docs/gl_objects/commits.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/gl_objects/commits.py b/docs/gl_objects/commits.py index 3046513..2ed66f5 100644 --- a/docs/gl_objects/commits.py +++ b/docs/gl_objects/commits.py @@ -9,6 +9,26 @@ commits = project.commits.list(ref_name='my_branch') commits = project.commits.list(since='2016-01-01T00:00:00Z') # end filter list +# create +# See https://docs.gitlab.com/ce/api/commits.html#create-a-commit-with-multiple-files-and-actions +# for actions detail +data = { + 'branch_name': 'master', + 'commit_message': 'blah blah blah', + 'actions': [ + { + 'action': 'create', + 'file_path': 'blah', + 'content': 'blah' + } + ] +} + +commit = gl.project_commits.create(data, project_id=1) +# or +commit = project.commits.create(data) +# end commit + # get commit = gl.project_commits.get('e3d5a71b', project_id=1) # or |