如何保存 diff 以供以后重用 - 类似于 TFS 中的 shelfset 的功能?
我对文件进行了一些更改,但意识到我需要以其他方式修改它 - 这需要我将当前的更改临时保存在其他地方并稍后应用。我如何在 svn/subversion 工具(例如 TortoiseSVN)中执行此操作?
我提到的功能与在 TFS 中制作 shelveset
和取消搁置非常相似。
如果您知道该怎么做,请帮忙。谢谢你!
I make some changes to a file but realize that I need to modify it in other way - this requires me to temporary save my current changes elsewhere and apply it later. How can I do this in svn/subversion tool, e.g. TortoiseSVN?
The feature I'm mentioning is very similar to making shelveset
and unshelving it in TFS.
Please help if you know how to. Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
AntonyW 的答案有效,但可能有点矫枉过正,特别是如果你有很多代码!
我不熟悉 TFS 的
shelveset
但 svn 为您提供了svn diff
命令来完成您正在寻找的操作:制作差异并保存它,以便您可以稍后应用。只需获取 svn diff 的输出并将其保存在 .patch 或 .diff 文件中。由于您使用的是 TortoiseSVN,这更容易做到。
AntonyW's answer works, but it might be overkill, especially if you've got a lot of code !
I'm not familiar with TFS'
shelveset
but svn gives you thesvn diff
command to do just what you're looking for: making a diff and saving it so you can apply it later. Just takesvn diff
's output and save it in a .patch or .diff file.Since you're using TortoiseSVN, this is even easier to do.
您还可以根据更改创建分支。它甚至可能比将差异存储在磁盘上更好。
编辑:
那么您对工作副本有不同类型的更改吗?
您想要保留的文件和想要保存到 diff 的文件?
在这种情况下,也许从 TortoiseSVN 创建补丁会更好。
但是,如果您想修补工作副本中的所有更改,我认为最好创建分支。
这在 Tortoise 中非常简单:
对于舒尔来说,它在大多数情况下对我有用,补丁适合代码审查,而不适合创建本地工具集未完成的更改;)
You can also create branch with your changes. It could be even better than storing diff on disk.
Edit:
So you have different kind of changes in working copy?
Files that you want to keep and files that you want to save to diff?
In this case maybe creating patch from TortoiseSVN is better.
But if you want to put in patch all changes from working copy it is better in my opinion to create branch.
This is really easy in Tortoise:
For shure it works for me most of the time, patches are good for code review, not for creating local toolset of not finished changes ;)
关于上面给出的答案,我(个人)不同意他们(批量等......)。对于我来说(我也在使用它),这是目前仅由团队基金会支持并且可以跨网络使用的好功能之一。这在以下情况下很有帮助:
我搜索了这个功能,发现大多数其他产品(SVN、mercurial)将来都会引入这个功能,但目前还没有。
……请求原谅总是比请求许可更好……
Regarding the above answers that are given, I (personally) disagree with them (bulk etc...). As for me (and I am using it as well), this is one of the good features that currently is supported only by team foundation and can be used across a network. This helps a lot in the following situation:
I searched for this feature and found that most of the other products (SVN, mercurial) are going to introduce this feature in the future, but it's not available yet.
...it's always better to ask for forgiveness rather than permission....
我通常会检查一个新位置,在那里进行更改然后提交。
稍后,我对原始位置进行更新,将更改合并到我之前修改的版本中。
I usually do a checkout to a new location, make the changes there then commit.
Later, I do an update on the original location to merge the changes into my previously modified version.