Temporarily put away uncommitted changes in Subversion (a la “git-stash”)

前端 未结 16 1731
轮回少年
轮回少年 2020-11-28 17:18

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 impl

16条回答
  •  感情败类
    2020-11-28 18:05

    Based on the Walter's answer I have created the following aliases in my bashrc file:

    alias svn.stash='read -p "saving local changes in raq.patch. Existing stash in raq.patch will be overwritten. Continue?[y/N]" && [[ $REPLY =~ ^[yY] ]] && rm -f raq.patch && svn diff > raq.patch && svn revert -R .'
    alias svn.stash.apply='patch -p0 < raq.patch; rm -f raq.patch'
    

    These aliases are much easier to use and remember.

    Usage:

    svn.stash to stash changes and svn.stash.apply to apply stash.

提交回复
热议问题