Simon Kiely
Simon Kiely

Reputation: 6070

Is it possible to push to Gitlab with the Python API?

I am just messing around, but I have a blank project in Gitlab. I have a Python script (well, ipython notebook). I would like the Python script to simply push any files in "C:/users/files" to the Gitlab project.

I cannot find any instruction on how to do this from the API webpage here - https://python-gitlab.readthedocs.io/en/stable/gl_objects/commits.html.

It looks to me like it is impossible to do this, but surely it is.

Upvotes: 1

Views: 2009

Answers (1)

phd
phd

Reputation: 95149

Push is not possible with API but only possible with Git protocol. You can use GitPython (depends on git as it runs git under the hood) or dulwich (doesn't depends on git as it implements Git protocol in Python).

Upvotes: 5

Related Questions