Moving from clearcase to git. Need to dump history

好久不见. 提交于 2020-01-03 03:28:15

问题


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


来源:https://stackoverflow.com/questions/37048859/moving-from-clearcase-to-git-need-to-dump-history

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!