1

I have query on moving from ClearCase to Git.

Currently we have the build environment setup on ClearCase.
The reason for moving to ClearCase is that the it's too slow for huge builds. At times it takes hours for the build.

Build on ClearCase is done on dynamic views.

So the plan is to use ClearCase as a repository to Git.

To elaborate, I would have the working directory in my PC with Git and once the changes are frozen adding to ClearCase.

Is it possible to do so? If yes, how?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250

1 Answers1

0

The reason for moving to clearcase is that the it's too slow for huge builds.

I suppose you meant "moving "from" ClearCase (to Git)

A build can be slow on a dynamic view as opposed to a snapshot view: write operation through the network (for dynamic view and its MVFS) is much slower than write operation on the local disk (snapshot view).

Using a snapshot view would be more appropriate, but let's assume this isn't possible in your case.

You can version any part of the ClearCase view in a git repo:

cd /path/to/ClearCase/view/vobs/aVob/path/to/folder
git init .
git add -A .
git commit -m "first commit"

Then you would need to clone that git repo somewhere on your disk (or the compilation wouldn't get much faster)

cd /path/to/your/disk
git clone /path/to/ClearCase/view/vobs/aVob/path/to/folder
cd folder

You can then compile, make modification and version them.

To get those modifications back in your ClearCase view, it is best to do so on a snapshot ClearCase view:

cd /path/to/snapshot/ClearCase/view/vobs/aVob/path/to/folder
git remote add origin /path/to/your/disk/folder
git branch -u origin/master master
git pull

Then your snapshot view will detect all the hijacked files that you can then checkout and checkin.

But if, as mentioned above, you cannot have a snapshot view, then you can use clearfsimport:

clearfsimport -preview -rec -nset . /path/to/ClearCase/view/vobs/aVob/path/to/folder

That wouldn't import the history.
To keep the history, see "Clearcase : Migrate from GIT to Clearcase"

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250