使用 SourceTree 强制推送

发布于 2025-01-03 03:09:50 字数 177 浏览 1 评论 0原文

几天前,我开始使用 SourceTree 在我的 Mac 上管理 Mercurial 存储库。现在,当推送到我的远程存储库在新分支上创建一个新头并且我想强制它时,我遇到了问题。

但是,我无法在 SourceTree 中找到任何允许我设置推送的强制选项的特定选项。是我找不到它还是无法设置它?

提前致谢 迈克尔

I started using SourceTree a few days ago to manage Mercurial repositories with my Mac. Now I ran into the problem when pushing to my remote repository creates a new head on a new branch and I would like to force it.

However, I am not able to find any specific option in SourceTree which allows me to set the force option for a push. Is it just my inability to find it or is there no possibility to set it?

Thanks in advance
Michael

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

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

发布评论

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

评论(6

在 SourceTree 3 中,您可以在高级选项卡中允许它:

在此处输入图像描述

In SourceTree 3 you can allow it in the advanced tab:

enter image description here

書生途 2025-01-10 03:09:50

SourceTree终于要添加强制推送了:
https://jira.atlassian.com/browse/SRCTREE-1156

原因:
https:// /answers.atlassian.com/questions/54469/how-do-i-perform-a-forced-push-push-f-from-sourcetree

编辑:
现在它已添加到 SourceTree 中,但您需要在设置中打开该选项。

SourceTree is finally going to add force push:
https://jira.atlassian.com/browse/SRCTREE-1156

Reason:
https://answers.atlassian.com/questions/54469/how-do-i-perform-a-forced-push-push-f-from-sourcetree

Edit:
It is now added in SourceTree, but you need to turn the option on in the settings.

鱼窥荷 2025-01-10 03:09:50

您可以在“设置”->“设置”中显示它。高级->允许强制推送

“在此处输入图像描述”"

然后强制推送选项将可用。

输入图片此处描述

You can show it on Settings -> Advanced -> Allow force push

enter image description here

Then force push option would be available.

enter image description here

别低头,皇冠会掉 2025-01-10 03:09:50

在 SourceTree 版本 2.5.5.0 中,有一个选项。

确保您已在选项中启用:

[菜单]工具->选项-> [选项卡] Git -> [部分]启用强制推送

在此处输入图像描述

之后,您可以使用工具栏中的按钮强制推送它:

<图片src="https://i.sstatic.net/B0pRg.png" alt="在此处输入图像描述">

它有效!

In SourceTree version 2.5.5.0 there is an option for that.

Make sure you have enabled in options:

[Menu] Tools -> Options -> [Tab] Git -> [Section] Enable Force Push

enter image description here

After that, you can force push it using push button in toolbar:

enter image description here

And it works!

没︽人懂的悲伤 2025-01-10 03:09:50

SourceTree(从版本 1.4.2 开始)根据需要发出 hg push --new-branch ,因此如果您创建一个新分支(而不是在一个分支上有两个头),您只需定期推送(存储库推送)。如果您在多个分支上有传出变更集,则可以选择指定要推送的分支。

我无法找到通过 SourceTree 对话框正确执行 hg Push --force 的方法。我同意@Ry4an 的观点,即这个选项危险多于有用。自从引入 --new-branch 以来,我从未做过强制推送,也从未需要它来组合不相关的存储库或推送双头分支(强制拉更安全)。

我的结论是,在极少数需要强制推送的情况下,打开终端不会有什么坏处。如果您不同意,请在评论中分享您的工作流程。

SourceTree (as of ver. 1.4.2) issues a hg push --new-branch as needed, so if you create a new branch (as opposed to having two heads on one branch), you just do a regular push (RepositoryPush). You can, optionally, specify a branch you want to push if you have outgoing changesets on several branches.

I wasn't able to find a way to do a hg push --force proper via the SourceTree dialogs. I agree with @Ry4an that this option is more dangerous than useful. I've never done a force push since --new-branch was introduced, and never needed it to combine unrelated repositories or push a two-headed branch (a force pull is much safer).

I conclude that on a rare occasion when a force push is needed, opening Terminal won't hurt. If you disagree, please share your workflow in comments.

煞人兵器 2025-01-10 03:09:50

它现在位于 Sourcetree -> 下首选项->高级->允许用力推动

it's now under Sourcetree -> Preferences -> Advanced -> Allow force push

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