GIT and RTC integration via scm command line
Hello,
We're looking at integrating GIT repositories into RTC SCM. We need to create an automation that would access the .git directories and store them into RTC on a daily base.
Is there any sample code on how to use the scm command line to achieve what we need? How would scm handle the daily code changes?
Thank you in advance for any pointers.
Accepted answer
Hi EclipseTalk,
From what you have described, I believe you need to maintain the git objects (i.e., the ".git" directory) of a Git Repository in RTC SCM. If that is the case, you can try the following:
From what you have described, I believe you need to maintain the git objects (i.e., the ".git" directory) of a Git Repository in RTC SCM. If that is the case, you can try the following:
1. Create (or clone) a Git Repository inside a RTC SCM Sandbox, and share it into a Stream (component).
2. If you intend to store only the objects, then ignore the other files and folders apart from ".git" using the RTC client. It generates a .jazzignore file, check in the same. This makes sure that only the ".git" repository and its contents are being tracked by RTC SCM.
If the Git Repository in question is a bare repository or a mirror, then this may not be needed.
3. Now deliver the change-set containing the objects and references in the ".git" folder. The .git repository is now shared with RTC SCM.
Lets say that there are more commits pushed / created into this repository. Now, when you open an RTC client, and set to the same sandbox (as done above), it can detect that there are new changes to the ".git" directory, and is shown in the Pending Changes, and can be delivered to RTC Stream.
You may want to do this often.
As to whether you can do it via the SCM command line - yes, it should be possible, since from the RTC SCM CLI's perspective, the git repository is yet another folder, which can be tracked, checked in and delivered.
As to whether you can do it via the SCM command line - yes, it should be possible, since from the RTC SCM CLI's perspective, the git repository is yet another folder, which can be tracked, checked in and delivered.
(See SCM CLI commands: scm refresh, scm status, scm checkin, scm deliver commands).
Comments
Geoffrey Clemm
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Sep 16 '13, 4:58 p.m.Just for interest's sake, why would you store a GIT repository inside of an RTC SCM repository?
EclipseTalk .
Sep 17 '13, 1:02 p.m.That's a good question and I don't quite agree but it's a customer requirement...
Geoffrey Clemm
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Sep 17 '13, 11:13 p.m.If the customer cannot explain to you why they are doing it, there's a good chance that doing so will not achieve whatever result they are hoping to achieve. For example, if they are looking for some kind of integration between RTC-SCM and GIT, this is unlikely to achieve it. Or if they are looking for some mechanism to back-up their GIT repositories, this wouldn't be a good way to do so.
EclipseTalk .
Sep 18 '13, 8:54 a.m.I totally agree with you Geoffrey; any recommendations?