将代码推送到受保护的git分支 [英] Pushing code to protected git branch

查看:2009
本文介绍了将代码推送到受保护的git分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



嗨伙计们:


我们正在转向TFS 2017年,我们处于设计的中间,例如Git repos等的分支政策。我对此有疑问。对于任何功能仓库,我们希望为成功构建启用分支策略。
对于主分支,我们正在启用成功构建和代码审查的策略。场景是我使用Visual Studio将代码更改为本地功能分支。我能够将此更改提交到本地分支。现在,当我尝试将此更改
推送到团队资源管理器中的远程功能分支时,它不允许我使用此错误消息,该消息是基于featurebranch上的策略设置的预期



推送期间报告了以下错误:

refs / heads / testing123,TF402455:不允许推送到此分支;你必须使用拉取请求来更新这个分支。



但我的问题是如何创建此拉取请求,因为我允许在网页上创建的拉取请求仅跟踪从远程功能到远程主分支的更改。我的更改仍在本地
功能分支中。请指导。



谢谢你


Sandeep


Hi folks

We are moving to TFS 2017 and we are in middle of the design such as branch policies for Git repos, etc. I have a query regarding that. For any feature repo, we want to enable the branch policy for the successful build. For the master branch, we are enabling the policies for successful build and code review. Scenario is that I make a code change to a local feature branch using Visual Studio. I was able to commit this change to local branch. Now when I try to push this change to the remote feature branch in Team Explorer, it is not allowing me with this error message which is expected based on the policy set on featurebranch

The following errors were reported during push:
refs/heads/testing123, TF402455: Pushes to this branch are not permitted; you must use a pull request to update this branch.

But my question is how do I create this pull request since the pull requests which I am allowed to create on the web page only track changes from remote feature to remote master branch. My changes are still in the local feature branch. Pls guide.

Thanks

Sandeep

推荐答案

您好Sandeep,

Hi Sandeep,

如果为功能分支设置策略,则需要使用拉取请求来更新它。

If you set a policy for feature branch, you will need to use a pull request to update it.

在您的方案中,您可以考虑为功能分支创建CI构建,而不是添加策略来保护它。

In your Scenario, you could consider to create a CI build for feature branch instead of add policy to protect it.

最好的问候


这篇关于将代码推送到受保护的git分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆