使用 SourceTree 强制推送
几天前,我开始使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
在 SourceTree 3 中,您可以在高级选项卡中允许它:
In SourceTree 3 you can allow it in the advanced tab:
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.
您可以在“设置”->“设置”中显示它。高级->允许强制推送
然后强制推送选项将可用。
You can show it on Settings -> Advanced -> Allow force push
Then force push option would be available.
在 SourceTree 版本 2.5.5.0 中,有一个选项。
确保您已在选项中启用:
之后,您可以使用工具栏中的按钮强制推送它:
<图片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:
After that, you can force push it using push button in toolbar:
And it works!
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 (Repository → Push). 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.
它现在位于 Sourcetree -> 下首选项->高级->允许用力推动
it's now under Sourcetree -> Preferences -> Advanced -> Allow force push