我想通过使用gitlab api来更改文件和提交的上下文。我看了api文档,但找不到办法。文档链接在这里; https://docs.gitlab.com/ee/api/
是否可以更改文件并提交?你有什么例子吗?
以下是通过api:https://docs.gitlab.com/ee/api/repository_files.html#update-existing-file-in-repository更新文件的官方文档
例:
curl --request PUT --header 'PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK' 'https://gitlab.example.com/api/v4/projects/13083/repository/files/app%2Fproject%2Erb?branch=master&author_email=author%40example.com&author_name=Firstname%20Lastname&content=some%20other%20content&commit_message=update%20file'
你应该为这个用例使用git,而不是那个不是为此设计的API!