Skip to content

Configuring Git in Martini Designer

This guide provides a comprehensive overview of configuring and using Git in Martini Designer, including creating repositories, cloning, pulling, committing, and pushing changes.

Best Practice

It is recommended to have one Git repository per Workspace in Martini Desktop or Martini Online for optimal organization and management.

Creating a Git Repository

To create a Git repository in Martini Designer:

  1. Open Martini Desktop:

    • Go to File >> Switch Workspace >> New/Existing workspace.
  2. Specify Workspace Path:

    • Enter the path for your new workspace (e.g., /my-workspace) and click Enter.
  3. Access the Git Perspective:

    • Once the workspace loads, switch to the Git perspective by clicking the Git or Source Control icon in the sidebar.

Cloning a Remote Repository

To clone a remote repository into your workspace:

  1. Shut Down Martini Runtime (if it's running).

  2. Open the Git Perspective:

    • Click the Source Control icon located in the sidebar.
  3. Add a Remote:

    • Click the Clone button beside the Push button.
  4. Enter Remote URI:

    • Copy the URI of the remote repository (e.g., from Bitbucket) and specify the branch you want to clone.
    • You can choose to clone using SSH or HTTPS. Ensure SSH keys are correctly configured if using SSH.
  5. Fetch and Reset:

    • After cloning, access the Git menu by clicking the three-dot menu.
    • Navigate to Pull, Push and select Fetch... to choose a remote repository and fetch changes.
  6. Verify Files:

    • Go to the Designer perspective, start Martini Runtime, and check if the files are present.

Pulling Commits from a Remote Repository

To fetch and pull commits from a remote repository:

  1. Access Source Control options:

    • Click the Source Control icon on the sidebar and open the three-dot menu.
    • You will find all Git commands including Pull and Fetch
  2. Fetch from Remote:

    • Select the Fetch option to retrieve the latest changes from the remote repository without applying them locally.
  3. Compare and Pull:

    • Use the Pull or Pull From command (available in the three-dot menu) to merge the remote changes into your local repository.
    • Open the History view to review and compare remote commits with your local changes.
  4. Verify Changes:

    • Go to the Designer perspective and check if the updates are reflected.

Committing Changes

To commit files to your Git repository:

  1. Create and Save Files:

    • Create a package and service, then save them.
  2. Stage and Commit:

    • Go to the Git perspective and open the staging view.
    • Stage files by selecting them and clicking the plus button.
    • Write a commit message and click the Commit button (the Check icon).
  3. Modify and Commit:

    • Make changes to files (e.g., update service logic), save, and stage the changes.
    • Write a commit message describing the modifications and click Commit.
  4. Compare Versions:

    • Look for files marked with a yellow M icon, indicating they have been modified.
    • Click the history icon located in the sidebar then select a commit to view the changes. This will open a comparison view, allowing you to review differences between the current version and the previous version.

Pushing Commits to a Remote Repository

To push commits from your local repository to a remote repository:

  1. Add Remote Repository:

    • Copy the SSH URL of your remote repository.
    • In Martini Designer, go to Source Control.
    • Click the Clone button and input the SSH URL of your remote repository.
    • Configure the repository by clicking Save.
  2. Push Branch:

    • Click the Push button (an arrow up icon) to push commits.
    • You can also push by using Push from under the three-dot menu.
  3. Verify Push:

    • Refresh your remote repository page to ensure the files and commits are visible.