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 ?开发者_StackOverflow中文版
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
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
- https://gist.github.com/1373136 - create
- https://gist.github.com/1373142 - remove
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.
精彩评论