Git – How Best Can I Use Git When My Employer Uses VSS

gitversion controlworkflows

I am going to be working with VSS but I am much more productive and diligent with GIT.

I have to fit within the workflow of VSS and keep good history in VSS. The standard work flow here with VSS is

  • get working copy
  • do work
  • right click on folder -> show differences
  • in that view:
    • checkout (without overwriting local changes)
    • checkin (keeping write access)
    • Add comment with specific template

Personally I think this is already side-stepping the intended workflow of VSS and potentially overwrites any changes made by other people.

I think I can prevent the possible overwrite, but are there any other potential problems that I should be aware of with this workflow?

–EDIT–

It's worth mentioning that in this case VSS is only used on legacy projects, and its largely treated with scorn by both the people that use it and the people that maintain it.

80% of the people that use it, use it alongside another version control system (some git, most mercurial)

When I asked the sys admin what my workflow should be, I was told "whatever your preference". I have kept them up to date with my thinking and they are interested in the results.

I would not recommend using any extreme methods (such as my script below) unless you have discussed it with whoever maintains VSS

Best Answer

You're forgetting something - standard workflow with VSS is:

  • checkout working copy
  • (optionally complain others have some files locked)
  • do work on files
  • (optionally deal with complaints that you have files locked)
  • checkin files.

What you need to understand is that while you can get a read-only copy, you cannot change files or commit changes unless you have a checkout which locks files so no-one else can modify them. So while your concept of working independently by migrating a working copy to git regularly is laudable, I doubt it'll work in practice. You will have to perform a checkout (that locks files) at the last moment, merge these latest files from VSS into your git repo, and then checkin the resulting merge into VSS.If someone else is working on these files when you decide you want to merge, you'll have to wait for them to finish. Also you'll have to lock all the files, as you won't (easily) know which have been changed since you took your last read-only copy.

Its better to organize the work you're doing, or the files you're working on, with your colleagues and just use the tool as it was intended. The important part of that is to communicate and organize the team's development work rather than work independently like you want to do using git.