[英]how can i upload a single file to specified branch of specified project by java code , as there is no suitable api interface
Anybody knows the implementation of function of uploading a entire file to a specific branch of a specific project on gitlab UI portal ?有人知道将整个文件上传到 gitlab UI 门户上特定项目的特定分支的功能的实现吗?
I want to upload a single file to specified branch of specified project , but there is no suitable api interface.我想上传单个文件到指定项目的指定分支,但是没有合适的api接口。 I have checked the gitlab api document, and there is
"POST /projects/:id/uploads"
which help upload a file to a project but not under the branch of the project , and "/projects/:id/repository/files/:filePath"
which creates a new file under the specified branch of project but it only support content of file ,not a entire file.我检查了 gitlab api 文档,有
"POST /projects/:id/uploads"
有助于将文件上传到项目但不在项目分支下,还有"/projects/:id/repository/files/:filePath"
在项目的指定分支下创建一个新文件,但它只支持文件的内容,而不是整个文件。 So, these two interfaces cannot solve my problem.所以,这两个接口不能解决我的问题。
Does anyone face the issue ?有人面临这个问题吗? any help will be appreciated!
任何帮助将不胜感激!
You have the commit API: https://docs.gitlab.com/ee/api/commits.html#create-a-commit-with-multiple-files-and-actions你有提交 API: https : //docs.gitlab.com/ee/api/commits.html#create-a-commit-with-multiple-files-and-actions
This seems to be what you need.这似乎是你所需要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.