更新文件并使用gitlab进行提交
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了更新文件并使用gitlab进行提交相关的知识,希望对你有一定的参考价值。
我想通过使用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'
相关问题:Updating and committing file by using gitlab api
另一答案
你应该为这个用例使用git,而不是那个不是为此设计的API!
以上是关于更新文件并使用gitlab进行提交的主要内容,如果未能解决你的问题,请参考以下文章