压入SourceTree [英] Squash in SourceTree

查看:86
本文介绍了压入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的SourceTree

从1.5版开始,,您现在可以进行交互式变基,这将使您可以壁球.

Updated Answer

SourceTree for Windows

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

交互式资源库已在 SourceTree中提供适用于Mac(自1.6版起)(重点是我的):

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

git rebase –interactive 命令允许您在创建提交之后(但在将它们公开之前)重新组织提交,现在您可以在SourceTree中进行此操作.组合(压扁)多个提交,或者简单地通过拖动&.您还可以更改提交消息,或编辑提交的内容.只需右键单击日志中的提交,然后选择以交互方式重新设置< sha> 的子级",即可开始该过程.

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版.

但是,该功能似乎在Windows版本的SourceTree中似乎不可用,而当前版本仍为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

要了解有关如何使用命令行来压缩提交的更多信息,请参见 免费在线Pro Git图书中的"noreferrer>压榨" a>.

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天全站免登陆