Moving from clearcase to git. Need to dump history

2019-06-03 00:42发布

问题:

I have a clearcase repository and I am planning to move it to git. Is there a way I can dump all the history?

回答1:

In addition to my old answer "ClearCase to Git migration" (2014), and by contrast with the 2016 "Git - ClearCase methodology", I would add (2016):

You need to check:

  • the nature of the import (is is a full ClearCase vob) or well defined ClearCase folder you want to imports?
  • are you working with ClearCase UCM or non-UCM?
  • Do you have some labels (or UCM baselines) in the history of your ClearCase Vob?

Only labelled (or baselined) ClearCase versions can be safely imported into a git repo, as they are similar to git commits.


The other approach is to actually dump the history (ie not keep it in the new git repo), keep said history in ClearCase (in read-only mode for archive).

Then the solution is simple: go to a ClearCase snapshot view, do a git init ., then git add ., git commit -m "first import".
You can the add a remote (to an empty bare repo), push and you are done.

git remote add origin /url/to/bar/repo
# for instance
git remote add origin https://github.com/<user>/<repo>
# or an internal server to your company
git remote add origin https://mycompany.com/gitlab/<project>/<repo>

git push -u origin master


标签: clearcase