Enabling the standard Git storage mode
Two Git storage mechanisms are available in Talend Studio: a standard storage mode and a customized one. The customized Git storage mode is implemented using multiple working trees:
- Every branch on a repository is checked out in a separate folder within a repository folder <studio-workspace>\.repositories\<repo-hashcode>.
- Using Git commands in Git tools to manage your repositories and projects is not supported. As only a partial subset of Git functionality is implemented in Talend Studio, it is impossible to perform some Git operations like Git fetch on your projects.
A Git storage mode based on the standard Git storage has been introduced to improve the way the Git objects for your repositories and projects are stored. A Git storage mode notification dialog box pops up in the bottom right corner after you install the Talend Studio monthly update. The Enable the standard Git storage mode option in Talend Studio Preferences dialog box and the new -Dgit.mode.standard parameter enable the standard Git storage mode.
The most important advantages of the standard Git storage mode over the customized Git storage mode are:
- There is only one working tree after initializing a local repository and only one branch checked out within a repository folder <studio-workspace>\<repo-name>-<repo-hashcode> at every given time, thus saving the disk space.
- It allows you to use Git commands in Git tools to manage your repositories and projects in a more powerful way. Note that you must exit Talend Studio when running Git commands in a Git tool.
The following diagram illustrates the differences of the way Git objects are stored within a local repository between the customized Git storage mode and the standard Git storage mode:
Pay attention to the following before enabling the standard Git storage mode:
- The standard Git storage mode is enabled by default for new workspaces.
- If there are any invalid project references, you need to fix them according to your needs before enabling the standard Git storage mode. For more information, see Fixing invalid project references for the standard Git storage mode.
- You must commit all your changes before enabling the standard Git storage mode. Otherwise, your changes will be lost if you switch to another branch when Talend Studio restarts after enabling the standard Git storage mode.
- The Enable the standard Git storage mode option in Talend Studio Preferences dialog box applies to all repositories in your current workspace. If you want to enable the standard Git storage mode in all your workspaces, set the -Dgit.mode.standard parameter to true in the corresponding .ini file under the Talend Studio installation directory according to your operating system.
- If a repository has not been checked out, after the standard Git storage mode is enabled, the Git objects in the repository will be saved within a repository folder <studio-workspace>\<repo-name>-<repo-hashcode> for the standard Git storage mode after checkout.
- If a repository has already been checked out, after the standard Git storage mode is
enabled, the local repository will be automatically migrated upon project logon. The
Git objects within the repository folder
<studio-workspace>\.repositories\<repo-hashcode> will
be kept, and the Git objects for the standard Git storage mode will be saved within
another repository folder
<studio-workspace>\<repo-name>-<repo-hashcode>.
Alternatively, you can switch to a new workspace, enable the standard Git storage mode, and then check out the Git objects in the repository within a repository folder for the standard Git storage mode directly.
- If you disable the standard Git storage mode and work back in the customized storage mode for any reason, before enabling the standard Git storage mode again, you must delete the existing repository folder <repo-name>-<repo-hashcode> for the standard Git storage mode to migrate your changed Git objects to the standard Git storage mode.
- If you have enabled the standard Git storage mode, when you log on to a remote
project, Talend Studio
checks the repository folder of the customized Git storage mode for the project and
cleans up the folder automatically if it is not in use for 15 days, which helps save
disk space.
After cleaning up a repository folder of the customized Git storage mode, when you log on to any project in the repository, the Enable the standard Git storage mode option in Talend Studio Preferences dialog box appears dimmed and you can no longer change the Git storage mode.
About this task
Procedure
-
If you want to enable the standard Git storage mode for all repositories in
your current workspace:
-
If you want to enable the standard Git storage mode in all your
workspaces:
- Add -Dgit.mode.standard=true in the corresponding .ini file under the Talend Studio installation directory according to your operating system.
- Restart your Talend Studio.