将 Git 与 Visual Source Safe 6.0 结合使用

发布于 2024-08-14 11:49:38 字数 507 浏览 8 评论 0 原文

很抱歉这个可怕的问题......但我没有办法不使用 VSS。

我希望能够在使用 Visual Source Safe 6 的同时在本地使用 Git 进行分支开发等。目前,我对 Git 的所有来龙去脉的了解有限,因为我是最近才皈依的。

问题:
我希望能够在 Git 存储库中工作。我想这样做,并获得分支等所允许的所有好处。在一天结束时,或在其他需要的时刻,我希望能够接受我正在做的任何工作并将其放置到主存储库中,然后我将其放入 VSS 中。

理想情况下,在工作日开始时,我会获得 VSS 最新版本.. 将其提交到 Git.. 然后在备用分支上工作,当我需要提交到 VSS 时将更改放回到 master 中。

由于我是一个相对的 git 新手,那么完成此操作的最佳方法可能是什么......以及发出/设置此操作的最佳命令。

*注意:我认为 Source Safe 需要先检出文件,然后才能对其进行更改。也许我可以使用一些工具/脚本来帮助自动化此操作,以将更改推回到 VSS 中?

Sorry for this horrid, horrid question.. but there's no way for me to not use VSS.

I would like to be able to use Git locally for branch development, etc. while using Visual Source Safe 6. My knowledge of all of the ins and outs of Git is limited at the moment, as I'm a recent convert.

Question:
What I would like to be able to do is work within a Git repository. I would like to do this and get all of the goodies that this will allow with branching, etc. At the end of my day, or at other needed moments I would like to be able to take whatever work I'm doing and place it into the master repository which I would then place into VSS.

Ideally, at the start of the work day I would get VSS latest version.. commit this to Git.. then work on an alternate branch, putting the changes back into master when I needed to commit to VSS.

Being that I am a relative git newbie, what might be the best way to accomplish this.. along with the best commands to issue/way to set this up.

*note: Source Safe needs the file checked out before changes can be made to it I think. Maybe there is some tool / script I can use to help automate this for pushing changes back into VSS ?

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

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

发布评论

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

评论(3

东风软 2024-08-21 11:49:38

您正在考虑的设置应该可以正常工作。对于 git 命令,只需查看教程。

我使用的工作流程(不是使用 VSS,但概念是相同的)类似于:

  • 从主分支(即 VSS)签出
  • 保留一个与 VSS 同步的“主干”分支
    • 始终保持清洁
  • 在从“主干”分支的分支中开发
  • 从VSS更新:
    • 切换到“中继”
    • 使用 VSS 更新
    • git 提交更改
    • 对从主干分支的分支进行变基
  • 要将更改推送到 VSS:
    • 将更改从开发分支推送到“主干”
    • 切换到“中继”
    • VSS 提交更改

The setup you're considering should work fine. For git commands just check the tutorials.

The workflow I've used (not with VSS, but the concept is the same) is something like:

  • Checkout from main (i.e. VSS)
  • Keep one "trunk" branch that is in sync with VSS
    • will always be kept clean
  • Develop in branches branched from "trunk"
  • Updating from VSS:
    • switch to "trunk"
    • update with VSS
    • git commit the changes
    • rebase the branches that are branched from trunk
  • To push changes to VSS:
    • push changes from the development branch to "trunk"
    • switch to "trunk"
    • VSS commit the changes
梦与时光遇 2024-08-21 11:49:38

如果您必须处理分支,任何使用 VSS 的人可能会发现以下帖子很有用:

http://timwise.blogspot.com/2011/11/multiple-working-folders-for-git-on.html

它基本上详细介绍了使用 SysInternals' Junction 以获得 Windows 中的符号链接支持,然后在 VSS 强加给您的物理分支文件夹之间共享 git 存储库通过复制 .git 文件夹中的文件并符号链接这些文件夹。

以下是自动共享的脚本

Anyone stuck with VSS may find the following post useful if you have to deal with branches:

http://timwise.blogspot.com/2011/11/multiple-working-folders-for-git-on.html

It basically details using SysInternals' Junction to get symlink support in Windows and then sharing a git repo between the physical branch folders that VSS forces on you by copying the files in the .git folder, and sym-linking the folders.

And here are the scripts for automating the sharing

糖果控 2024-08-21 11:49:38

我也陷入了这个困境,我的做法是不让其他人接触我的VSS,并一直检查所有文件,这意味着没有其他人可以做出贡献,所以这自然不是每个人都可行的解决方案。
我建议的解决方案是:

  • 从 VSS Chekout
  • 创建一个分支来处理您的功能
  • 完成您的功能的工作
  • 切换到主分支
  • 更新最新的 VSS
    • 如果进行了任何更改,请重新设置您的分支的基础
  • 使用 $ git diff --name-status master..branchName 查看更改了哪些文件(请参阅 显示哪些文件在两个版本之间发生了更改了解此内容的来源)
  • 检查更改的文件
  • 使用 VSS Merge 你的分支到master上(最好删除你的功能分支)
  • 提交到VSS

其中一些你可能可以通过脚本来摆脱,但由于你很可能使用M$(因为你正在使用VSS)这不是我可以做的帮助你。

VSS 的工作方式我认为最好尽量减少从 VSS 检出文件所花费的时间,因此这是一个更好的方法。

请注意,更新文件可能会出现一些问题,因为 VSS 会自动在未签出的文件上设置只读标志。这里可能需要一个解决方法。

I am also caught in this, the way I do it is to not have others touch my VSS and have all the files checked out all the time, this means noone else can contribute, so this is naturally not a viable solution for everyone.
The solution I would suggest is that you:

  • Chekout from VSS
  • Create a branch to work on your feature
  • finish work on your feature
  • Switch to Master branch
  • Update latest VSS
    • If any changes are done, rebase your branch
  • See what files are changed using $ git diff --name-status master..branchName ( see Showing which files have changed between two revisions for the source of this )
  • Check out the altered files using VSS
  • Merge your branch onto master ( preferably deleting your feature branch )
  • Commit to VSS

Some of these you might be able to script your way out of, but since you are most probably using M$ (since you are using VSS) this is not something I can help you with.

The way VSS works I would think that it would be better to minimize the time spent with the files checked out of VSS and therefore that this is a better way.

Be advised, there may be some problems updating the files, as VSS automagically sets the readonly flag on files that are not checked out. A workaround might be needed here.

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