很抱歉这个可怕的问题......但我没有办法不使用 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 ?
发布评论
评论(3)
您正在考虑的设置应该可以正常工作。对于 git 命令,只需查看教程。
我使用的工作流程(不是使用 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:
如果您必须处理分支,任何使用 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
我也陷入了这个困境,我的做法是不让其他人接触我的VSS,并一直检查所有文件,这意味着没有其他人可以做出贡献,所以这自然不是每个人都可行的解决方案。
我建议的解决方案是:
$ git diff --name-status master..branchName
查看更改了哪些文件(请参阅 显示哪些文件在两个版本之间发生了更改了解此内容的来源)其中一些你可能可以通过脚本来摆脱,但由于你很可能使用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:
$ git diff --name-status master..branchName
( see Showing which files have changed between two revisions for the source of this )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.