Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When working on a project, you may in the Translator there may be certain files you do not want to commit track in a file to Git , for example if it contains confidential information. To stop Iguana X from committing specific files, you can add them to a repository, such as files that may contain confidential information. A Git Ignore (.gitignore) file .

This page contains a sample .gitignore file you can use.

The file works like this:

  1. Place the .gitignore file attached in this document into your component directory:

Code Block
/Users/iguanaxUser/Library/IguanaX/repos/<component_guid>/
  1. Edit the .gitignore file to include what you want to ignore:

This example file will ignore all the Sample data in the specific components directory:

Code Block
/Samples/*
  1. Make an initial commit, connect your component to a repository and make sure the specified files are not there.

NOTE: Adding the .gitignore file before adding the samples folder works easier. If you already have the samples folder you may need to delete that folder and re-upload it.

...

can be added to a Translator project to exclude files from being traced by Git.

How to create a .gitignore file to the Translator:

Expand
titleSTEP 1: In terminal or command prompt, navigate to your Iguana X repository file for the desired component.

Navigate to your Iguana X component repos file. You may find this in the default location:

For Windows:

Code Block
languagebash
C:\ProgramData\IguanaX\repos\<component_guid>

For Linux:

Code Block
languagebash
/home/<user>/iguana/repos/<component_guid>
Expand
titleSTEP 2: Create a .gitignore file for your component.

For Windows:

  1. Create the .gitignore hidden file

Code Block
languagebash
echo. > .gitignore
  1. Open the file in notepad to manually edit the file.

Code Block
notepad .gitignore

For Linux:

  1. Create the .gitignore hidden file

Code Block
touch .gitignore
  1. Open the file in editor mode

Code Block
vi .gitignore
Expand
titleSTEP 3: Edit .gitignore to exclude files from being tracked by git.

Specify the files which you want to ignore, meaning they will be excluded from your repository.

You can also add exceptions to your exclusions. For example, you can add exceptions to the Samples folder if you have some sample data that doesn’t have any sensitive info that you want to keep in the component’s Git history (e.g. if it’s a template component).

The following example includes an example .gitignore file for sample data:

Code Block
# Ignore all files within the "Samples" folder
/Samples/*

# Exceptions (files to include)
!/Samples/Sample_001
Expand
titleSTEP 4: In the Translator, make a commit, push your commit to your linked repository and check if the files exist.

Once you’ve created your .gitignore file, any changes you commit and push to your linked upstream repository will not contain the ignored files. You can confirm this by navigating to your repository and viewing the latest commits.