How do I avoid checking in local changes to the SV

2019-02-13 16:38发布

I have to make local changes to my project files in order to get it to run in a different environment. Twice now I accidentally checked those changes in (and messed up everyone else's running environment).

There are probably a lot of better ways to set up our build, but since I work as a consultant on an established project I can't really change how the customer works.

I've tried setting up a second branch in the same repository (which backfired, duplicating the entire tree in the root of their repository--I won't be messing around with that again).

Tried setting up a second repository of my own and checking in JUST those files to the new repository. This got really messy as well and basically didn't work.

I'm considering SVK--it looks like it MIGHT be able to help, but I can't quite figure out a pattern that would work.

I think I even posted here and didn't get a good answer, but that was before I was seriously considering SVK--I figured with that new parameter there might be a better solution.

I realize I could track the changes I WANT to check in and then just check those in, but that's a human dependent and buggy procedure that, to date, has failed me twice (because I'm a buggy human).

Any suggestions on just how to do this?

标签: svn svk
8条回答
聊天终结者
2楼-- · 2019-02-13 17:07

What client do you use?

TortoiseSVN has a nifty feature that takes advantage of the changelist feature built into SVN. If you right click on a modified folder and choose "Check for Modifications," you can right-click on any of the modified files in that dialog and choose "Add to Changelist -> ignore-on-commit." From then on, whenever you perform a commit Tortoise makes sure not to add those files to the commit. See "Excluding Items from the Commit List" on this page.

If you're not using tortoise, you could set up a similar changelist manually.

查看更多
冷血范
3楼-- · 2019-02-13 17:14

When I have a situation like this, I add the files that I do not want to check in to a change set labelled "DO NOT CHECK IN". My SVN client (SmartSVN, although Tortoise does also suuprt this) can then be set to ignore that change set, meaning that I don't accidentally check in those changes.

The only downside to this is when you have made changes to files in the change set that you do actually want to check in - you then have to manually remember to check them in.

查看更多
登录 后发表回答