I have a clearcase repository and I am planning to move it to git. Is there a way I can dump all the history?
Asked
Active
Viewed 986 times
1
-
By dump do you mean remove history? – Muhammad Bilal May 05 '16 at 11:07
-
Possible duplicate of [ClearCase to Git migration](http://stackoverflow.com/questions/26967817/clearcase-to-git-migration) – Muhammad Bilal May 05 '16 at 11:09
1 Answers
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
-
Hi, thanks for the prompt reply. I did not understand the first question. I am using UCM-Clearcase. Yes I have labels and UCM baselines. – Ritwik Paul May 09 '16 at 13:57
-
@RitwikPaul Then the answer stands: import one UCM component per git repo, one baseline at a time (from the oldest baseline to the newest) – VonC May 09 '16 at 14:13