GithubHelp home page GithubHelp logo

slamottem's Introduction

vault2git

Creates a Git repository from a SourceGear Vault repository.

Why?

I tend to prefer Git’s workflow and merging model over Vault, and wanted to convert some of my Vault repos to Git rather than abandoning all of my versioning history. It looks like a lot of others feel the same way, but there don’t seem to be many solutions. I found one .NET program that will do it, but I don’t have VS2010 installed, plus I am a big Ruby fan so I decided to create my own converter one weekend and share it.

Process

The conversion process is pretty BFI-y. Given a Vault repository, it creates a new Git repository, fetches the list of Vault versions, then iterates through each of the versions performing the following steps:

  • clear out the Git repository folder (except .git* files)
  • fetch the current version’s files from Vault
  • add and commit the version to Git, including a descriptive comment

The comments written to Git include the original Vault comments (if any) plus a one-liner containing the original Vault version number, check-in time, etc. The original Vault check-in time is used as the commit’s time.

Clearly this isn’t an optimal algorithm, but it works. And really, how often are you going to do this? I have one project that has hundreds of source files AND some large binary library files with over 500 versions, and it runs in something like eight hours. But it works so I’m happy.

Invoking

Launch the app with ruby vault2git and you’ll see the help screen which should be enough to get you started. An example might be:

bundle exec ruby vault2git --host localhost --repo "My Repo" $/Vault/Folder c:/New/Git/Repo

Wrap parameter values in double-quotes as required. IMPORTANT: the paths MUST use forward slashes to delimit folders even in Windows.

Requirements

  • Vault client installed (uses the command-line client)
  • Ruby 2.5.8
  • Bundler gem: installed dependencies with bundle install

Known Issues

  • Can be slow for large repositories
  • The .gitignore created by default (specifically for my project) should be turned into a customizable template.
  • I no longer have access to a Windows machine or Vault so it’s difficult for me to update this project.

slamottem's People

Contributors

chengchanghuv avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.