Moving from ClearCase to Git

一笑奈何 提交于 2019-12-01 11:55:22
VonC

First you can read this comparison between ClearCase and Git

As explained in Middle-ground between submodules and branches?, the one concept which is likely to trick you when coming from ClearCase is the notion of composition (configuration inheritance): see Flexible vs static branching (GIT vs Clearcase/Accurev).

ClearCase works file by file (or activity by activity, each activity being a group of files).
Git works blob delta by blob delta (each blob representing a content: if two files have the same content, only one "blob" will be stored)

That means what you are trying to do in ClearCase through branch/streams and activities (if you are using UCM), will more likely be achieved through:

  • commit reordering (rebase --interactive, which is the "git" way, and not recommended in mercurial)
  • and/or publication (which is an orthogonal dimension to branching, specific to DVCS)

reordering + merge (only for commits not yet "published", ie not pushed):
You are reordering the modifications deltas applied to your code, in order to merge only what you want.

trunk => trunk'  QA => QA'  stable
  A        B'    
  |        |  
  B        D'
  |        |  
  C        A'----A'    C''
  |        |     |     |
  D        C'    C'    A''--  A''  (--: merge to branch)
  |        |     |     |      |
  E        E     E     E      E
  • reordering + publication (push):

You can also represent each code promotion by a git repo of its own.
Once the commits are in the proper order, you push the relevant branches to a QA repo, or a stable repo.


The reordering (history rewriting) is:

See also:

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