暂时收起 Subversion 中未提交的更改(a la “git-stash") [英] Temporarily put away uncommitted changes in Subversion (a la "git-stash")

查看:42
本文介绍了暂时收起 Subversion 中未提交的更改(a la “git-stash")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当编程软件存储在 Subversion 存储库中时,我经常修改一些文件,然后注意到我想为我的主要工作做一些准备性更改.例如.在实现新功能时,我注意到一些可能对我有帮助的重构.

While programming software stored in a Subversion repo, I often modify some files, then notice that I'd like to do some preparatory change for my main work. E.g. while implementing new functionality, I notice some refactoring which might help me.

为了不混合两个不相关的更改,在这些情况下,我想收起"我的更改,即恢复到存储库版本,做一些其他更改,提交这些,然后取回"我的更改.

In order not to mix two unrelated changes, in these cases I'd like to "stow away" my changes, i.e. revert to the repository version, do some other changes, commit these, then "fetch back" my changes.

git-stash 允许这样做.有没有办法用 Subversion 直接或使用一些插件或脚本来做到这一点.Eclipse 插件也可以.

git-stash allows to do just that. Is there some way to do this with Subversion, either directly or with some plugin or script. Eclipse plugins would also be fine.

推荐答案

当我的工作副本中的一项任务有未提交的更改并且我需要切换到另一项任务时,我会做以下两件事之一:

When I've got uncommitted changes from one task in my working copy and I need to switch to another task, I do one of two things:

  1. 检查第二个任务的新工作副本.

  1. Check out a new working copy for the second task.

开始一个分支:

workingcopy$ svn copy CURRENT_URL_OF_WORKING_COPY SOME_BRANCH
workingcopy$ svn switch SOME_BRANCH
workingcopy$ svn commit -m "work in progress"
workingcoyp$ svn switch WHATEVER_I_WAS_WORKING_ON_BEFORE

我有一些脚本可以帮助自动执行此操作.

I have some scripts that help to automate this.

这篇关于暂时收起 Subversion 中未提交的更改(a la “git-stash")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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