使用 Git 在 Talend Studio 的共享存储库中存储您的所有工程数据,如作业、数据库连接、例程、小作业、数据模型、流程、存储进程 。
开始之前
有关受支持的 Git 服务器的更多信息,请参阅兼容的版本控制系统。
步骤
- 在 https://git-scm.com/downloads 下载对应于您系统的 Git 版本,并遵循安装说明。
-
在 Talend Studio 创建 SSH 密钥对而不是使用Git工具,以确保密钥与 Talend Studio 兼容。
- 打开 Git Bash。
-
用下述命令生成一个新密钥,其中 email 为 Git 服务器账户的邮件地址:
ssh-keygen -t ecdsa -b 256 -m PEM -C "email"
- 当收到输入要保存密钥的文件的提示时,直接按回车键接受默认保存位置,或者键入文件名然后按回车键确认。
- 当提示您输入密码时,按回车键将其留空。
- 将生成的密钥文件放在 C:\Users\User_Name\.ssh 文件夹中。
-
将公钥添加到您的 Git 服务器的设置中。
-
通过执行以下命令创建 known-hosts 文件:
ssh-keyscan.exe -H git_server_hostname >> known_hosts
-
如果您使用多个 SSH 私钥,请在 .ssh 文件夹中创建一个 config文件,然后在文件中添加以下内容,以指定哪个密钥文件用于哪个 Git 服务器。
警告: 此config 文件优先于 Eclipse 配置。
Host <git_server1_hostname> IdentityFile C:/users/username/.ssh/key1 Host <git_server2_hostname> IdentityFile C:/users/username/.ssh/key2
-
通过执行以下命令创建 known-hosts 文件:
-
将连接信息添加到 Talend Administration Center 配置。更多信息,请参见 Talend Administration Center 用户指南中的 Setting up Git parameters (英文版) 一节。
提示:
当 Talend Administration Center 作为服务运行时,确保 known_hosts 文件位于正确的文件夹中。若非如此,则将 known_hosts 文件复制到 user.home\.ssh 文件夹 (或者,如果不存在 .ssh 文件夹,则新建该文件夹)。
当 Talend Administration Center 作为 Windows 服务运行时,user.home 类似于:C:\Windows\System32\config\systemprofile。