更新文件并使用gitlab进行提交

问题描述 投票:1回答:2

我想通过使用gitlab api来更改文件和提交的上下文。我看了api文档,但找不到办法。文档链接在这里; https://docs.gitlab.com/ee/api/

是否可以更改文件并提交?你有什么例子吗?

api gitlab commit
2个回答
1
投票

以下是通过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'

相关问题:Updating and committing file by using gitlab api


-1
投票

你应该为这个用例使用git,而不是那个不是为此设计的API!

© www.soinside.com 2019 - 2024. All rights reserved.