简体   繁体   English

如何从Shell /命令行创建对存储的拉取请求?

[英]How to create pull requests for stash from shell/commandline?

我正在运行Atlassian stash,可以在基于Web的UI上看到Pull Request选项,但是我想知道我的用户是否可以在不使用Stash Web UI的情况下从其控制台为其工作副本创建Pull Request?

There are 2 Stash command line tools available: 有2种Stash命令行工具可用:

https://bitbucket.org/atlassian/stash-command-line-tools https://bitbucket.org/atlassian/stash-command-line-tools

https://marketplace.atlassian.com/plugins/org.swift.stash.cli https://marketplace.atlassian.com/plugins/org.swift.stash.cli

Note that a pull request requires commits in a branch to be pushed rather than using the local working copy, and this works well in practice. 请注意,拉取请求需要推送分支中的提交,而不是使用本地工作副本,这在实践中效果很好。

I have never done this, but it should be possible using the Stash REST api via some bash script or something to do the POST 我从未做过,但是应该可以通过一些bash脚本或执行POST的操作使用Stash REST api

/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests
This API can also be invoked via a user-centric URL when addressing repositories in personal projects. 当寻址个人项目中的存储库时,也可以通过以用户为中心的URL调用此API。 Create a new pull request between two branches. 在两个分支之间创建一个新的拉取请求。 The branches may be in the same repository, or different ones. 分支可以在同一存储库中,也可以在不同的存储库中。 When using different repositories, they must still be in the same {@link Repository#getHierarchyId() hierarchy}. 使用不同的存储库时,它们仍必须位于相同的{@link Repository#getHierarchyId()层次结构}中。

The authenticated user must have REPO_READ permission for the "from" and "to"repositories to call this resource. 经过身份验证的用户必须对“从”和“到”存储库具有REPO_READ权限才能调用此资源。

It sounds like quite some work, considering you will need to authenticate and all that, but it might still be worth it for you 考虑到您将需要进行身份验证之类的事情,这听起来似乎有些工作,但是对于您来说还是值得的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM