前提
python-gitlab 1.4
gitlab使用v3接口
示例代码
import gitlab
host = 'http://xxxx.com'
project_id = "xxxx"
gl = gitlab.Gitlab(host, private_token="xxx", api_version='3')
p = gl.projects.get(project_id, lazy=True)
print(p.branches.list())
python-gitlab 1.4
gitlab使用v3接口
import gitlab
host = 'http://xxxx.com'
project_id = "xxxx"
gl = gitlab.Gitlab(host, private_token="xxx", api_version='3')
p = gl.projects.get(project_id, lazy=True)
print(p.branches.list())