Best Practice

ONE Desktop Git recommendations

  • 24 March 2022
  • 0 replies
  • 418 views

General

It is strongly recommended not to place an Eclipse Project directly inside the git repository.

That means, avoid having .git directory and .project file at the same level - instead, place the project into a sub directory.

On the other hand, there are particular config files which you typically keep at the same level as .git directory:  .gitattributes and .gitignore. We use them to control some processes when working with Git. Note: settings in these files will override any git global settings on your computer.
Example of recommended setup is as follows:

 

.gitattributes

The file provides a possibility to control certain operations in the git repository. Especially it is important to keep the line endings (prevents Git from normalizing them) as provided in the Ataccama default Eclipse Project content because:

  • Prevents the "The project signature is invalid" issue resulting into a state when you are not able to see/work with the Project at all (entire project tree is not visible).
  • Prevents from false reported changes in generated files - when generating files like components, plans, workflows, etc. the line endings should not differ from the remote repo no matter what OS you use to run the ONE Desktop (Eclipse).

The recommended setting a procedure is to make sure you follow these steps before you push any Eclipse Project (RDM, MDM, etc.) into the git repo for the first time:

  1. Create an empty repository and push it to remote (or if you already have an empty remote repository, just clone it to your local computer).
  2. Create the .gitattributes file with following content: * -text
  3. Push the file to the remote origin (this is important to do before anybody else will do their first checkout of the repository).
  4. Now you can add the Eclipse Project to the repository and work normally (push it to the remote origin, i.e. share it , etc.).

Of course, you can skip this procedure if you have the .gitattributes with the mentioned setting already as a part of the content (along with the Ataccama Eclipse Project) being pushed to the repository. Important is that this file becomes part of the repository before anyone else starts working with it (i.e. checking out from the remote origin).

.gitignore

It is recommended to avoid keeping certain project files from the git repository, such as:

  • Generated lookups: binary files (diff makes not much sense) which are generated upon request/via orchestration which is typically scheduled on the server where the full solution is running, not your local computer.
  • Large source files: can be text files but their size would make git repo to grow excessively; moreover again, as a part of the orchestration, they might be part of some download process on the server.

Also, you can define exceptions here if needed. Example how to ask git to ignore all the lookup files in the lkp directory (no matter the dir. level) except for one specific file, ___country_preferred_out_language.lkp (this only file will be synchronized with the repository): 

!RDM_lab/Files/data/lkp/
RDM_lab/Files/data/lkp/**/*.lkp
!RDM_lab/Files/data/lkp/___country_preferred_out_language.lkp

 


0 replies

Be the first to reply!

Reply