SourceTree 中的壁球 [英] Squash in SourceTree

查看:41
本文介绍了SourceTree 中的壁球的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 SourceTree 中压缩?我看到显然您可以拖放"提交以压缩它们.但是,当我这样做时,它只会突出显示几个提交.

Is it possible to squash in SourceTree? I saw that apparently you can "drag and drop" commits in order to squash them. However, when I do that it only highlights several commits.

推荐答案

更新答案

Windows 源代码树

从 1.5 版起,您现在可以进行交互式 rebase,这将允许您压缩.

Updated Answer

SourceTree for Windows

As of version 1.5, you can now do interactive rebases, which will allow you to squash.

交互式 rebase 已在 SourceTree 中可用Mac 版本 1.6(强调我的):

Interactive rebase has been available in SourceTree for Mac since version 1.6 (emphasis mine):

git rebase –interactive 命令允许您在创建提交之后(但在公开之前)重新组织提交,现在您可以在 SourceTree 中执行此操作.将多个提交组合(压缩)在一起, 或重新排序,只需拖动 &删除.您还可以更改提交消息,或编辑提交的内容.只需右键单击日志中的提交,然后选择以交互方式重新设置 的子项"即可启动该过程.

The git rebase –interactive command allows you to reorganise your commits after you’ve created them (but before you’ve made them public), and now you can do this inside SourceTree. Combine (squash) multiple commits together, or re-order them, simply by dragging & dropping. You can also change the commit message, or edit the content of the commits. Just right-click on a commit in the log and choose ‘Rebase children of <sha> interactively’ to kick the process off.

旧答案

显然压缩提交是 中的一项功能适用于 Mac 的 SourceTree 1.6 版.

但是,该功能在 SourceTree 的 Windows 版本中似乎不可用,该版本目前仍为 1.0.8 版.

您仍然可以选择使用命令行压缩提交:

You still have the option of using the command line to squash commits:

git rebase -i <sha-of-base-commit>

TODO 列表中,在提交旁边放置一个 s(用于压缩)以压缩到前一个提交中:

In the TODO list, put an s (for squash) next to commits to squash into the previous commit:

pick e953225 Add meow meow meow
s def892d Add master

要了解有关如何使用命令行压缩提交的更多信息,请参阅 Squashing Commits,来自免费在线 Pro Git 书籍一>.

To learn more about how to squash commits using the command line, see Squashing Commits, from the FREE online Pro Git book.

这篇关于SourceTree 中的壁球的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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