[英]pulling gitlab repository without password that is not under my profile but have full access to
[英]REST-full access: Cannot add file to repository in Gitlab
我尝试了以下请求:
curl -v -X POST --header "PRIVATE-TOKEN:myPrivateToken" 'url-of-gitlab/api/v3/projects/myProjectId/repository/files?file_path=1.json&branch_name=master&content=thefilecontent&commit_message=ACommitMessage'
然而,我总是得到
"message":"You can only create files if you are on top of a branch"
在回应中。 我不知道我的请求缺少什么。 存储库是新创建的,我是通过 Gitlab UI 创建的。 也许我需要先创建一个分支? 任何帮助都可以。 非常感谢。
存储库是新创建的,我是通过 Gitlab UI 创建的。
新创建的存储库(通过 GitLab 或什至是本地的简单git init
)没有分支(也没有 HEAD)。
这就是我在“为什么我需要明确推送一个新分支? ”中所描述的。
也许我需要先创建一个分支?
是的,你这样做(至少是一个master
分支)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.