开发者

Using a separate version control system for changes when main version control is not accessible

Here is my situation:

The project I'm working on right now uses a version control system (Microsoft Team Foundation) that's hosted and managed remotely by the customer. I am in charge of doing a massive refactoring/bugfixing after somebody who left a horre开发者_高级运维ndous mess of code behind. Due to several reasons that I won't detail here* I cannot commit to the version control my incremental changes while I patch things up; and there is no way I can be given a separate branch there.

Here is my question:

I want a version control system that I can use locally. I can't just keep doing "zip source folder and backup it". I want a track of changes. I want commit messages. I want to see what I did and when and why in a couple of months. In a pinch, I'm tired to rely on VS 'undo' command and to leave comments myself tracking what I'm doing and how it was before.

Here is what I would do:

I'd install mercurial/git locally and start versioning my own directories.

Problem is, I am not sure this is the best way. Hints? Ideas? I am not familiar at all with either Visual Studio or Team Foundation and can't seem to find my way around with them (I don't know how things are 'named' so I don't know what I'm looking for). Is it possible, using such tools, to do what I have described?

*basically the customer doesn't necessarily have to know that our lead developer quit in anger and left the most horrendous code mess I've ever seen behind me; that at least 3 people 'tried to fix' his code in a rush to patch bugs; that this ended up in a single class with a 400+ long method including a single 'for' loop, at least 5 places where code is repeated-but-not-completely, unused logic, wrong comments, while(true) loops, and increasing the 'for' counter in the loop body to look-ahead into an array list. Basically, we hope the customer won't notice what's happening and if they do we can fix it when they whine.


The usual approach is to:

  • "git init" directly in the directory you want to manage locally
  • add a .gitignore in order to not add any VCS-specific data or directory
  • git add .gitignore and commit
  • git add .
  • commit

That way, you have a local repo you can then clone, make branches, patches, ...
(I do it for ClearCase views for instance)

A similar approach, with similar commands, is valid with Hg Mercurial of course.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜