当主版本控制无法访问时,使用单独的版本控制系统进行更改

发布于 2024-08-24 01:41:36 字数 851 浏览 6 评论 0原文

这是我的情况:

我现在正在做的项目 使用版本控制系统 (微软团队基金会)那就是 由远程托管和管理 顾客。我负责做一个 之后进行大规模重构/错误修复 留下一团糟的人 代码后面。由于多种原因 我不会在这里详细说明*我不能 提交版本控制我的 修补时增量更改 事情发生了;我没有办法 在那里有一个单独的分支。

这是我的问题:

我想要一个可以在本地使用的版本控制系统。我不能只是继续执行“zip 源文件夹并备份它”。我想要跟踪变化。我想要提交消息。我想看看我在几个月内做了什么、何时以及为什么。在紧要关头,我厌倦了依赖 VS 的“撤消”命令并自己留下评论来跟踪我正在做的事情以及之前的情况。

这是我要做的:

我会在本地安装 mercurial/git 并开始对我自己的目录进行版本控制。

问题是,我不确定这是最好的办法。提示?有想法吗?我对 Visual Studio 或 Team Foundation 一点也不熟悉,并且似乎无法找到使用它们的方法(我不知道事物是如何“命名”的,所以我不知道我在寻找什么) 。使用这些工具是否可以实现我所描述的功能?

*基本上,客户不一定要知道我们的首席开发人员愤怒地退出并留下了我所见过的最可怕的代码混乱;至少有 3 个人“试图修复”他的代码,急于修补错误;这最终在一个类中包含了 400 多个长方法,包括一个“for”循环,至少有 5 个代码重复但不完整的地方,未使用的逻辑,错误的注释,while(true) 循环,以及增加循环体​​中的“for”计数器以向前查看数组列表。基本上,我们希望客户不会注意到发生了什么,如果他们注意到了,我们可以在他们抱怨时解决问题。

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 horrendous 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

庆幸我还是我 2024-08-31 01:41:36

通常的做法是:

  • git init”直接在想要本地管理的目录中
  • 添加一个 .gitignore,以便不添加任何 VCS 特定的数据或目录
  • git add .gitignore 并提交
  • git add .
  • commit

这样,你就有了一个本地存储库,然后你可以克隆、创建分支、修补程序,...
(例如,我为 ClearCase 视图执行此操作

当然,类似的方法和类似的命令对于 Hg Mercurial 也是有效的。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文