为什么我的分支代码试图通过Intellij推动掌握

发布于 2025-02-08 18:54:46 字数 242 浏览 0 评论 0原文

我正在自己的git分支机构工作,我想对自己的分支做出承诺。但是它试图将代码推向主机。显然主人受到保护。所以我不能直接合并那里。如何解决这个问题?

I am working in my own git branch and I want to do my commit to my branch. But it is trying to push the code to master instead. And obviously master is protected. So I cannot directly merge there. How to solve this?
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

帅哥哥的热头脑 2025-02-15 18:54:46

在顶部的工具栏中,转到 git ,将出现一个下拉菜单。单击分支(或使用快捷键 ctrl + shift +`)。
有关存储库的分支机构的菜单将出现。

*在Intellij的较新版本中,您必须单击左上角的3个点,然后将出现工具栏,您将

在遥控器下找到git * ,您将有两个分支机构,Main和Master 。 单击主箭头并删除它...

,您都设置了。下次您提交并推动一些东西时,它将自动推到主分支!!!

(要检查它是否有效,在执行我提到的任何事情之后,单击“ ctrl + shift + k ”,提交和推动窗口将出现。在那里,您会发现“” Main->原点:Main “大声告诉它将将更改推向主分支

In the Tool Bar on the top, go to Git, and a drop-down menu will appear. Click on Branches (or use the Shortcut Key Ctrl + Shift + ` ).
A menu will appear regarding the branches of your repositories.

*In the newer versions of IntelliJ, you have to click on the 3 dots in the top left corner and then the Tool Bar will appear where you will find Git *

Under the Remote, you would have two branches, main and master. Click on the side arrow of master and delete it...

And you're all set. Next time you Commit and Push something, it will automatically be pushed to the main branch!!!

(To check if it works, after doing whatever I mentioned, click "Ctrl + Shift + K" and the Commit and Push window will appear. There, you will find "main -> origin : main" which is loudly telling out that it is going to push the changes to the main branch)

吃→可爱长大的 2025-02-15 18:54:46

使用CTRL + Shift + K进行推动,目标分支可以进行编辑和更改。
左侧是您正在工作的本地分支,右侧是目标远程分支,默认情况下它们具有相同的名称。

我的屏幕快照

use Ctrl + Shift + K to push, the target branch can be edit and change.
Left is the local branch you're working on, right is the target remote branch, they have the same name by default .

my screenshot

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文