Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes

Comments

Just for interest's sake, why would you store a GIT repository inside of an RTC SCM repository?  

That's a good question and I don't quite agree but it's a customer requirement...

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.

I totally agree with you Geoffrey; any recommendations?

Thanks


Accepted answer

Permanent link
 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:
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.
Sharing the (bare) Git Repository 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.
New Commits in the Git Repository

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.
(See SCM CLI commands: scm refresh, scm status, scm checkin, scm deliver commands).

EclipseTalk . selected this answer as the correct answer

0 votes

Comments

Thank you for the detailed explanation! 

 One clarification is in order: The above solution does not help with Migration or Synchronization scenarios. But, only for backing up the git repository inside RTC SCM.


One other answer

Permanent link
Hi,
It answers on a bit different question, however there is GIT adapter for RTC: https://jazz.net/library/article/854/

Let us know if it helps you as well.

0 votes

Comments

I don't think the current GIT adapter for RTC is relevant for this question ... it links GIT commits to RTC work items, but doesn't do any import of the actual GIT commits into the RTC SCM system.

That's correct we're not looking for an adapter 

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938
× 97

Question asked: Sep 12 '13, 10:50 a.m.

Question was seen: 7,158 times

Last updated: Sep 18 '13, 8:54 a.m.

Confirmation Cancel Confirm